Learn R Programming

datana (version 1.0.6)

beetles: Population density growth of beetles

Description

Temporal measurements of density of beetles (Tribolium confusum) growing in different controlled environments.

Usage

beetles

Arguments

Format

days

Number of days.

diet

The quantities of flour (in grams) of the environments where the beetles were growing. Six levels of the factor Diet.

type

The various stage of beetles, i.e., eggs, larvae, pupae, and adults.

density

The number of insects per environment.

References

- Chapman RN. 1928. The quantitative analysis of environmental factors. Ecology 9(2):111-122. tools:::Rd_expr_doi("10.2307/1929348")

Examples

Run this code
data(beetles)
table(beetles$type)
name.diet<-unique(beetles$diet)
num.diet<-length(name.diet)
##Time series plot
#first, some computation
alys<-with(beetles,tapply(density,list(as.factor(days),as.factor(diet)),sum))
out<-as.data.frame(alys)
out$time<-row.names(out)
head(out)
#Figure 1 of the paper
matplot(out[,"time"], out[,1:num.diet], las=1, type=c("b"),pch=1,
        xlab="Time in days",ylab="Total individuals")
legend("topleft", legend = name.diet, title = "Diet (gr)",
       col = 1:6, lty = 1:6, pch = 1)

Run the code above in your browser using DataLab