Fortify extrapolated species richness of a species pool
Source:R/fortify.poolaccum.R
fortify.poolaccum.RdPrepares a fortified version of results from
vegan::poolaccum() objects.
Arguments
- model, x
an object of class
vegan::poolaccum().- data
original data set. Currently ignored.
- alpha
level of quantiles for envelopes shown (default 0.05).
- ...
additional arguments passed to
vegan::summary.poolaccum(), notablydisplayto control which indices should be computed.
Value
A data frame with columns index, size, richness, lower,
upper, and std_dev, containing the richness index, permutation richness
estimator, sample size, upper and lower \(1 - \alpha\)
quantile interval, and standard deviation of permutation estimates,
respectively.
Examples
library("vegan")
library("ggplot2")
data(BCI)
pool <- poolaccum(BCI)
df <- fortify(pool)
df
#> # A tibble: 240 × 6
#> index size richness lower upper std_dev
#> <fct> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 S 3 138. 124. 149. 6.36
#> 2 S 4 150. 137. 160 6.02
#> 3 S 5 158. 147. 169. 5.92
#> 4 S 6 165. 154. 175. 5.19
#> 5 S 7 171. 162. 181 5.09
#> 6 S 8 175. 167 185. 4.86
#> 7 S 9 179. 170 188. 4.71
#> 8 S 10 183. 174. 190 4.79
#> 9 S 11 185. 177 195. 4.75
#> 10 S 12 188. 180 198. 4.66
#> # ℹ 230 more rows
ggplot(df, aes(x = size, y = richness, colour = index)) +
geom_ribbon(aes(ymin = lower, ymax = upper, x = size, fill = index),
alpha = 0.3, inherit.aes = FALSE) +
geom_line() +
facet_wrap(~ index)