Review data on evaporative water loss and make graph to examine differences among groups (treatments)
# Get data
data <- read.csv("http://vonmay.cikeys.com/wp-content/uploads/2020/03/AgarModelsLab.csv", stringsAsFactors=FALSE)
# Run the next line of code to take a look at the data
data
## Date Location TeamName SampleNbr Treatment Time1 Mass1 Time2
## 1 2020_0306 Artemisia patch BMFL 1 Sun_Dry 13_52 22.13 16_58
## 2 2020_0306 Artemisia patch JHEN 2 Shade_Dry 13_55 21.22 16_55
## 3 2020_0306 Artemisia patch Gryfindor 2 Sun_Dry 13_52 24.23 16_58
## 4 2020_0306 Artemisia patch Dolphins 1 Shade_Dry 13_54 22.72 16_55
## 5 2020_0306 Artemisia patch Gryfindor 2 Shade_Wet 13_55 20.74 16_56
## 6 2020_0306 Artemisia patch AMGEN 3 Sun_Wet 13_56 23.42 16_58
## 7 2020_0306 Artemisia patch BMFL 1 Sun_Wet 13_56 20.56 16_58
## 8 2020_0306 Artemisia patch JMRK 3 Shade_Dry 13_56 23.66 16_56
## 9 2020_0306 Artemisia patch AMGEN 3 Sun_Dry 13_52 22.23 16_58
## 10 2020_0306 Artemisia patch JMRK 3 Shade_Wet 13_55 22.81 16_56
## 11 2020_0306 Artemisia patch JHEN 2 Sun_Wet 13_56 21.36 16_58
## 12 2020_0306 Artemisia patch Dolphins 1 Shade_Wet 13_55 22.32 16_56
## Mass2 WaterLossPct TotTimeHr WaterLossPctPerHr
## 1 18.43 16.72 3.10 5.39
## 2 20.09 5.33 3.00 1.78
## 3 19.72 18.61 3.10 6.00
## 4 21.48 5.46 3.02 1.81
## 5 19.29 6.99 3.02 2.32
## 6 20.85 10.97 3.03 3.62
## 7 17.73 13.76 3.03 4.54
## 8 20.23 14.50 3.00 4.83
## 9 17.79 19.97 3.10 6.44
## 10 21.83 4.30 3.02 1.42
## 11 18.61 12.87 3.03 4.25
## 12 21.48 3.76 3.02 1.25
# Data of interest: WaterLossPctPerHr
# (percent of water loss per hour)
# Grouping variable: Treatment
Draw a strip chart
# Below, the tilde "~" means that the first argument is a formula, and it related one variable to the other
stripchart(WaterLossPctPerHr ~ Treatment, data = data, method = "jitter", vertical = TRUE)

Draw a more detailed strip chart with options
# If you use a PC, remove the # sign in next line and add # to following line
# windows(height=5, width=6)
quartz.options(height=5, width=6)
plot.new()
par(oma = c(0.1,1.0,0.1,0.1))
par(bty = "l") # plot x and y axes only, not a complete box
stripchart(WaterLossPctPerHr ~ Treatment, data = data, vertical = TRUE,
method = "jitter", pch = 16, col = "blue", cex = 1.5, las = 1,
ylab = "Percent of water loss (g/h)", xlab = "Treatment",
ylim = c(0, max(data$WaterLossPctPerHr)))
# Calculate the means in each treatment group
meanWaterLossPctPerHr = tapply(data$WaterLossPctPerHr, data$Treatment, mean)
meanWaterLossPctPerHr
## Shade_Dry Shade_Wet Sun_Dry Sun_Wet
## 2.806667 1.663333 5.943333 4.136667
# use command "segments" to draw mean values as lines
segments(x0 = c(1,2,3,4) - 0.1, y0 = meanWaterLossPctPerHr, x1 = c(1,2,3,4) + 0.1, y1 = meanWaterLossPctPerHr, lwd = 3)
