Prepares a fortified version of results from vegan::poolaccum() objects.

# S3 method for class 'poolaccum'
fortify(model, data, alpha = 0.05, ...)

Arguments

model

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(), notably display to 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.

Author

Gavin L. Simpson & Didzis Elferts

Examples

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.  127.  153.    7.12
#>  2 S         4     150.  138.  162.    6.64
#>  3 S         5     159.  148.  170     6.03
#>  4 S         6     166.  156   176     5.61
#>  5 S         7     171.  161.  181.    5.52
#>  6 S         8     175.  165.  185.    5.07
#>  7 S         9     179.  170   189.    4.83
#>  8 S        10     182.  174   192     4.68
#>  9 S        11     186.  177   195.    4.59
#> 10 S        12     188.  180   199     4.86
#> # ℹ 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)