data(wffc)
summary(wffc)
with(wffc, table(water,session))
# Obtain some simple plots
waihou = with(wffc, wffc[water=="Waihou",])
waimak = with(wffc, wffc[water=="Waimakariri",])
whang = with(wffc, wffc[water=="Whanganui",])
otam = with(wffc, wffc[water=="Otamangakau",])
roto = with(wffc, 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)"))
# Overall distribution of LOG length
with(wffc, boxplot(length/10 ~ water, ylim=c(minlength, maxlength)/10,
border="blue", log="y",
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))
# Overall distribution of proportion of number of captures
with(wffc, barplot(nwater / sum(nwater), cex.names=0.5,
main="Proportion of captures"))
# An interesting lake
with(roto, hist(length/10, xlab="Fish lengths (cm)", 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