# Species abundance models - použijeme data ktera jsou k dispozici v R-ku # data(BCI) - 50 společenstev a 225 druhů; pro matematicke modely potrebujeme velka spolecenstva library (vegan) data(BCI) a <- BCI[1, ] b <- BCI[2, ] c <- BCI[3, ] Na <- rowSums(a) Nb <- rowSums(b) Nc <- rowSums(c) Sa <- specnumber(a) Sb <- specnumber(b) Sc <- specnumber(c) Na Nb Nc Sa Sb Sc # Functions rad.null, rad.preempt, rad.lognormal, rad.zipf and zipfbrot fit the individual models for a single vector # (row of data frame), and function radfit fits all models.# The argument of the function radfit can be either a vector for a single community # or a data frame where # each row represents a distinct community. model.preempt_a <- rad.preempt(a) # geometric series model.preempt_a plot(model.preempt_a) model.lognormal_a <- rad.lognormal(a) # lognormal model.lognormal_a plot(model.lognormal_a) model.null_a <- rad.null(a) # brocken stick model.null_a plot(model.null_a) # podle hodnoty AIC a BIC muzeme shodnotit ktery model lepe vystihuje pozorovana data models_a <- radfit(a) # vsechny modely plot(models_a) ## Lattice graphics separately for each model radlattice(models_a)