summary(wffc)
with(wffc, table(water, session))
# Obtain some simple plots
waihou = subset(wffc, water == "Waihou")
waimak = subset(wffc, water == "Waimakariri")
whang = subset(wffc, water == "Whanganui")
otam = subset(wffc, water == "Otamangakau")
roto = subset(wffc, water == "Rotoaira")
minlength = min(wffc[,"length"])
maxlength = max(wffc[,"length"])
nwater = c("Waihou" = nrow(waihou), "Waimakariri" = nrow(waimak),
"Whanganui" = nrow(whang), "Otamangakau" = nrow(otam),
"Rotoaira" = nrow(roto))
par(mfrow = c(2,3), las = 1)
# Overall distribution of length
with(wffc, boxplot(length/10 ~ water, ylim = c(minlength, maxlength)/10,
border = "blue", main = "Length (cm)", cex.axis = 0.5))
# Overall distribution of LOG length
with(wffc, boxplot(length/10 ~ water, ylim = c(minlength, maxlength)/10,
border = "blue", log = "y", cex.axis = 0.5,
main = "Length (cm) on a log scale"))
# Overall distribution of number of captures
pie(nwater, border = "blue", main = "Proportion of captures",
labels = names(nwater), density = 10, col = 1:length(nwater),
angle = 85+30* 1:length(nwater))
# Overall distribution of number of captures
with(wffc, barplot(nwater, main = "Number of captures", cex.names = 0.5,
col = "lightblue"))
# Overall distribution of proportion of number of captures
with(wffc, barplot(nwater / sum(nwater), cex.names = 0.5, col = "lightblue",
main = "Proportion of captures"))
# An interesting lake
with(roto, hist(length/10, xlab = "Fish length (cm)", col = "lightblue",
breaks = seq(18, 70, by = 3), prob = TRUE, ylim = c(0, 0.08),
border = "blue", ylab = "", main = "Lake Rotoaira", lwd = 2))
Run the code above in your browser using DataLab