User Tools

Site Tools


cs:alpha_beta_diversity:solution_ex2

Řešení cvičení s Gentryho lesními transekty

# Nahrejte potřebná data:
 
f <- file ('http://www.davidzeleny.net/anadat-r/lib/exe/fetch.php?media=data:gentry197.r')
load (f)
gentry.coord <- read.delim ('http://www.davidzeleny.net/anadat-r/lib/exe/fetch.php?media=data:gentry.coord.txt', row.names = 1)
 
library (vegan)
 
# gamma diverzita v rámci lokalit:
gamma <- unlist (lapply (gentry197, ncol))
 
# průměrná alfa diverzita podploch v rámci lokalit:
mean.alpha  <- unlist (lapply (gentry197, FUN = function (x) mean (specnumber (x))))
 
# Whittakerova beta-diverzita
beta.whitt <- 1-(mean.alpha/gamma)
 
# rarifikovaná gamma diverzita
gentry.sum <- lapply (gentry197, FUN = function (x) as.matrix (colSums (x)))
min (unlist (lapply (gentry.sum, sum)))  # nejmenší počet jedinců na lokalitě
 
gamma.rarefied <- unlist (lapply (gentry.sum, FUN = function (x) rarefy (t(x), 43)))
 
par (mfrow = c(2,2))
plot (gamma ~ Lat, gentry.coord, col = 'blue', pch = 17, log = 'y', ylab = 'Diversity')
points (mean.alpha ~ Lat, gentry.coord, col = 'red', pch = 20)
 
plot (beta.whitt ~ Lat, gentry.coord)
 
plot (gamma.rarefied ~ Lat, gentry.coord)
 
plot (beta.whitt ~ gamma)

Srovnejte s obrázky Fig. 1 A+B a Fig. 2 B v publikaci Kraft et al. (2011) Science:

cs/alpha_beta_diversity/solution_ex2.txt · Last modified: 2017/10/11 20:36 (external edit)