Created
September 30, 2021 18:25
-
-
Save MJacobs1985/656ab9137f217945b52d8800489eed7a to your computer and use it in GitHub Desktop.
How many samples do you need?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### DATA IMPORT & MANAGEMENT #### | |
ARCdata <- read_csv("ARC_crosssectional_presentation.csv") | |
ARCdata$gain<-ARCdata$End-ARCdata$Start | |
str(ARCdata) | |
ARCdata<-as.data.frame(ARCdata) | |
ARCdata$Diet<-as.factor(ARCdata$Diet) | |
ARCdata$Tank<-as.factor(ARCdata$Tank) | |
#### DATA EXPLORATION #### | |
## Look at data | |
print(tapply(ARCdata$gain, ARCdata$Tank, mean, na.rm=TRUE)) | |
print(tapply(ARCdata$gain, ARCdata$Diet, mean, na.rm=TRUE)) | |
histogram(~ gain | Diet, data = ARCdata) | |
histogram(~ gain | Tank, data = ARCdata) | |
# number of observations by tank | |
ARCdata %>% | |
group_by(Tank) %>% | |
summarise(no_rows = length(Tank)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment