# # Exercise 2.1 # # Statistical Methods in Biology: Design and Analysis of Experiments and Regression # by S.J. Welham, S.A. Gezan, S.J. Clark & A. Mead (2014) # Chapman & Hall/CRC Press, Boca Raton, Florida. ISBN: 978-1-4398-0878-8 # Version 1, 16/09/2014 # Set working directory - use setwd() function or from Session menu in RStudio # e.g. setwd("d:/stats4biol/data) # Read data grass <- read.table("grass.dat",sep="",header=T) summary(grass) # Get factor with levels 0:15 (otherwise numbers with zero counts are skipped) grass$fCount <- factor(grass$Count, levels=c(0:15)) # Form table of counts Tcount <- table(grass$fCount) Tcount # Make barchart from table of counts barplot(Tcount) # Get summary statistics for counts summary(grass$Count) # Do boxplot of data boxplot(grass$Count) # End of file