Skip to contents

Function specaccum finds species accumulation curves or the number of species for a certain number of sampled sites or individuals.

Usage

specaccum(comm, method = "exact", permutations = 100,
          conditioned =TRUE, gamma = "jack1",  w = NULL, subset, ...)
# S3 method for specaccum
plot(x, add = FALSE, random = FALSE, ci = 2, 
    ci.type = c("bar", "line", "polygon"), col = par("fg"), lty = 1,
    ci.col = col, ci.lty = 1, ci.length = 0, xlab, ylab = x$method, ylim,
    xvar = c("sites", "individuals", "effort"), ...)
# S3 method for specaccum
boxplot(x, add = FALSE, ...)
fitspecaccum(object, model, method = "random", ...)
# S3 method for fitspecaccum
plot(x, col = par("fg"), lty = 1, xlab = "Sites", 
    ylab = x$method, ...) 
# S3 method for specaccum
predict(object, newdata, interpolation = c("linear", "spline"), ...)
# S3 method for fitspecaccum
predict(object, newdata, ...)
specslope(object, at)

Arguments

comm

Community data set.

method

Species accumulation method (partial match). Method "collector" adds sites in the order they happen to be in the data, "random" adds sites in random order, "exact" finds the expected (mean) species richness, "coleman" finds the expected richness following Coleman et al. 1982, and "rarefaction" finds the mean when accumulating individuals instead of sites.

permutations

Number of permutations with method = "random". Usually an integer giving the number permutations, but can also be a list of control values for the permutations as returned by the function how, or a permutation matrix where each row gives the permuted indices.

conditioned

Estimation of standard deviation is conditional on the empirical dataset for the exact SAC

gamma

Method for estimating the total extrapolated number of species in the survey area by function specpool

w

Weights giving the sampling effort.

subset

logical expression indicating sites (rows) to keep: missing values are taken as FALSE.

x

A specaccum result object

add

Add to an existing graph.

random

Draw each random simulation separately instead of drawing their average and confidence intervals.

ci

Multiplier used to get confidence intervals from standard deviation (standard error of the estimate). Value ci = 0 suppresses drawing confidence intervals.

ci.type

Type of confidence intervals in the graph: "bar" draws vertical bars, "line" draws lines, and "polygon" draws a shaded area.

col

Colour for drawing lines.

lty

line type (see par).

ci.col

Colour for drawing lines or filling the "polygon".

ci.lty

Line type for confidence intervals or border of the "polygon".

ci.length

Length of horizontal bars (in inches) at the end of vertical bars with ci.type = "bar".

xlab,ylab

Labels for x (defaults xvar) and y axis.

ylim

the y limits of the plot.

xvar

Variable used for the horizontal axis: "individuals" can be used only with method = "rarefaction".

object

Either a community data set or fitted specaccum model.

model

Nonlinear regression model (nls). See Details.

newdata

Optional data used in prediction interpreted as number of sampling units (sites). If missing, fitted values are returned.

interpolation

Interpolation method used with newdata.

at

Number of plots where the slope is evaluated. Can be a real number.

...

Other parameters to functions.

Details

Species accumulation curves (SAC) are used to compare diversity properties of community data sets using different accumulator functions. The classic method is "random" which finds the mean SAC and its standard deviation from random permutations of the data, or subsampling without replacement (Gotelli & Colwell 2001). The "exact" method finds the expected SAC using sample-based rarefaction method that has been independently developed numerous times (Chiarucci et al. 2008) and it is often known as Mao Tau estimate (Colwell et al. 2012). The unconditional standard deviation for the exact SAC represents a moment-based estimation that is not conditioned on the empirical data set (sd for all samples > 0). The unconditional standard deviation is based on an estimation of the extrapolated number of species in the survey area (a.k.a. gamma diversity), as estimated by function specpool. The conditional standard deviation that was developed by Jari Oksanen (not published, sd=0 for all samples). Method "coleman" finds the expected SAC and its standard deviation following Coleman et al. (1982). All these methods are based on sampling sites without replacement. In contrast, the method = "rarefaction" finds the expected species richness and its standard deviation by sampling individuals instead of sites. It achieves this by applying function rarefy with number of individuals corresponding to average number of individuals per site.

Methods "random" and "collector" can take weights (w) that give the sampling effort for each site. The weights w do not influence the order the sites are accumulated, but only the value of the sampling effort so that not all sites are equal. The summary results are expressed against sites even when the accumulation uses weights (methods "random", "collector"), or is based on individuals ("rarefaction"). The actual sampling effort is given as item Effort or Individuals in the printed result. For weighted "random" method the effort refers to the average effort per site, or sum of weights per number of sites. With weighted method = "random", the averaged species richness is found from linear interpolation of single random permutations. Therefore at least the first value (and often several first) have NA richness, because these values cannot be interpolated in all cases but should be extrapolated. The plot function defaults to display the results as scaled to sites, but this can be changed selecting xvar = "effort" (weighted methods) or xvar = "individuals" (with method = "rarefaction").

The summary and boxplot methods are available for method = "random".

Function predict for specaccum can return the values corresponding to newdata. With method "exact", "rarefaction" and "coleman" the function uses analytic equations for interpolated non-integer values, and for other methods linear (approx) or spline (spline) interpolation. If newdata is not given, the function returns the values corresponding to the data. NB., the fitted values with method="rarefaction" are based on rounded integer counts, but predict can use fractional non-integer counts with newdata and give slightly different results.

Function fitspecaccum fits a nonlinear (nls) self-starting species accumulation model. The input object can be a result of specaccum or a community in data frame. In the latter case the function first fits a specaccum model and then proceeds with fitting the nonlinear model. The function can apply a limited set of nonlinear regression models suggested for species-area relationship (Dengler 2009). All these are selfStart models. The permissible alternatives are "arrhenius" (SSarrhenius), "gleason" (SSgleason), "gitay" (SSgitay), "lomolino" (SSlomolino) of vegan package. In addition the following standard R models are available: "asymp" (SSasymp), "gompertz" (SSgompertz), "michaelis-menten" (SSmicmen), "logis" (SSlogis), "weibull" (SSweibull). See these functions for model specification and details.

When weights w were used the fit is based on accumulated effort and in model = "rarefaction" on accumulated number of individuals. The plot is still based on sites, unless other alternative is selected with xvar.

Function predict for fitspecaccum uses predict.nls, and you can pass all arguments to that function. In addition, fitted, residuals, nobs, coef, AIC, logLik and deviance work on the result object.

Function specslope evaluates the derivative of the species accumulation curve at given number of sample plots, and gives the rate of increase in the number of species. The function works with specaccum result object when this is based on analytic models "exact", "rarefaction" or "coleman", and with non-linear regression results of fitspecaccum.

Nonlinear regression may fail for any reason, and some of the fitspecaccum models are fragile and may not succeed.

Value

Function specaccum returns an object of class

"specaccum", and fitspecaccum a model of class

"fitspecaccum" that adds a few items to the

"specaccum" (see the end of the list below):

call

Function call.

method

Accumulator method.

sites

Number of sites. For method = "rarefaction" this is the number of sites corresponding to a certain number of individuals and generally not an integer, and the average number of individuals is also returned in item individuals.

effort

Average sum of weights corresponding to the number of sites when model was fitted with argument w

richness

The number of species corresponding to number of sites. With method = "collector" this is the observed richness, for other methods the average or expected richness.

sd

The standard deviation of SAC (or its standard error). This is NULL in method = "collector", and it is estimated from permutations in method = "random", and from analytic equations in other methods.

perm

Permutation results with method = "random" and NULL in other cases. Each column in perm holds one permutation.

weights

Matrix of accumulated weights corresponding to the columns of the perm matrix when model was fitted with argument w.

fitted, residuals, coefficients

Only in fitspecacum: fitted values, residuals and nonlinear model coefficients. For method = "random" these are matrices with a column for each random accumulation.

models

Only in fitspecaccum: list of fitted nls models (see Examples on accessing these models).

References

Chiarucci, A., Bacaro, G., Rocchini, D. & Fattorini, L. (2008). Discovering and rediscovering the sample-based rarefaction formula in the ecological literature. Commun. Ecol. 9: 121--123.

Coleman, B.D, Mares, M.A., Willis, M.R. & Hsieh, Y. (1982). Randomness, area and species richness. Ecology 63: 1121--1133.

Colwell, R.K., Chao, A., Gotelli, N.J., Lin, S.Y., Mao, C.X., Chazdon, R.L. & Longino, J.T. (2012). Models and estimators linking individual-based and sample-based rarefaction, extrapolation and comparison of assemblages. J. Plant Ecol. 5: 3--21.

Dengler, J. (2009). Which function describes the species-area relationship best? A review and empirical evaluation. Journal of Biogeography 36, 728--744.

Gotelli, N.J. & Colwell, R.K. (2001). Quantifying biodiversity: procedures and pitfalls in measurement and comparison of species richness. Ecol. Lett. 4, 379--391.

Author

Roeland Kindt r.kindt@cgiar.org and Jari Oksanen.

Note

The SAC with method = "exact" was developed by Roeland Kindt, and its standard deviation by Jari Oksanen (both are unpublished). The method = "coleman" underestimates the SAC because it does not handle properly sampling without replacement. Further, its standard deviation does not take into account species correlations, and is generally too low.

See also

rarefy and rrarefy are related individual based models. Other accumulation models are poolaccum for extrapolated richness, and renyiaccum and tsallisaccum for diversity indices. Underlying graphical functions are boxplot, matlines, segments and polygon.

Examples

data(BCI)
sp1 <- specaccum(BCI)
#> Warning: the standard deviation is zero
sp2 <- specaccum(BCI, "random")
sp2
#> Species Accumulation Curve
#> Accumulation method: random, with 100 permutations
#> Call: specaccum(comm = BCI, method = "random") 
#> 
#>                                                                              
#> Sites     1.00000   2.00000   3.00000   4.00000   5.00000   6.00000   7.00000
#> Richness 90.42000 121.29000 138.34000 150.46000 158.46000 165.38000 170.34000
#> sd        7.23931   7.43361   7.38305   6.80377   5.92959   5.07475   4.58196
#>                                                                             
#> Sites      8.00000   9.00000  10.00000  11.0000  12.00000  13.00000  14.0000
#> Richness 175.02000 178.93000 182.15000 184.8500 187.47000 189.88000 191.9000
#> sd         4.43808   4.74662   4.58671   4.4093   4.23419   4.08565   4.1451
#>                                                                               
#> Sites     15.00000  16.00000  17.00000  18.00000  19.00000  20.00000  21.00000
#> Richness 193.75000 195.50000 197.32000 198.94000 200.32000 201.68000 202.95000
#> sd         4.13503   4.01889   3.54447   3.53859   3.62617   3.62895   3.41528
#>                                                                             
#> Sites     22.00000  23.00000  24.00000  25.00000  26.00000  27.000  28.00000
#> Richness 204.17000 205.39000 206.65000 207.73000 208.91000 209.880 210.90000
#> sd         3.47009   3.28417   3.22357   3.06448   3.06856   3.217   3.14787
#>                                                                               
#> Sites     29.00000  30.00000  31.00000  32.00000  33.00000  34.00000  35.00000
#> Richness 211.64000 212.74000 213.57000 214.43000 215.15000 215.93000 216.75000
#> sd         3.12862   3.01719   3.01931   2.92069   2.76111   2.77163   2.69446
#>                                                                               
#> Sites     36.00000  37.00000  38.00000  39.00000  40.00000  41.00000  42.00000
#> Richness 217.54000 218.20000 219.00000 219.61000 220.14000 220.77000 221.28000
#> sd         2.62629   2.64384   2.45361   2.22427   2.11307   1.93769   1.82618
#>                                                                              
#> Sites     43.00000  44.00000  45.00000  46.00000  47.00000  48.0000  49.00000
#> Richness 221.86000 222.33000 222.85000 223.28000 223.69000 224.1400 224.60000
#> sd         1.79235   1.49784   1.45904   1.36389   1.07961   0.8764   0.58603
#>             
#> Sites     50
#> Richness 225
#> sd         0
summary(sp2)
#>  1 sites          2 sites         3 sites         4 sites        
#>  Min.   : 77.00   Min.   :105.0   Min.   :119.0   Min.   :132.0  
#>  1st Qu.: 85.00   1st Qu.:115.8   1st Qu.:134.0   1st Qu.:146.0  
#>  Median : 88.00   Median :121.5   Median :139.0   Median :151.0  
#>  Mean   : 90.42   Mean   :121.3   Mean   :138.3   Mean   :150.5  
#>  3rd Qu.: 94.25   3rd Qu.:126.0   3rd Qu.:143.2   3rd Qu.:155.0  
#>  Max.   :109.00   Max.   :144.0   Max.   :155.0   Max.   :166.0  
#>  5 sites         6 sites         7 sites         8 sites       9 sites        
#>  Min.   :140.0   Min.   :149.0   Min.   :157.0   Min.   :161   Min.   :166.0  
#>  1st Qu.:155.0   1st Qu.:162.0   1st Qu.:168.0   1st Qu.:173   1st Qu.:176.0  
#>  Median :159.0   Median :165.0   Median :171.0   Median :175   Median :179.0  
#>  Mean   :158.5   Mean   :165.4   Mean   :170.3   Mean   :175   Mean   :178.9  
#>  3rd Qu.:163.0   3rd Qu.:170.0   3rd Qu.:174.0   3rd Qu.:178   3rd Qu.:182.0  
#>  Max.   :172.0   Max.   :176.0   Max.   :181.0   Max.   :186   Max.   :190.0  
#>  10 sites        11 sites        12 sites        13 sites       
#>  Min.   :170.0   Min.   :174.0   Min.   :174.0   Min.   :179.0  
#>  1st Qu.:179.0   1st Qu.:182.0   1st Qu.:184.0   1st Qu.:187.0  
#>  Median :183.0   Median :185.0   Median :188.0   Median :190.5  
#>  Mean   :182.2   Mean   :184.8   Mean   :187.5   Mean   :189.9  
#>  3rd Qu.:185.0   3rd Qu.:188.0   3rd Qu.:191.0   3rd Qu.:193.0  
#>  Max.   :191.0   Max.   :193.0   Max.   :200.0   Max.   :202.0  
#>  14 sites        15 sites        16 sites        17 sites       
#>  Min.   :181.0   Min.   :183.0   Min.   :185.0   Min.   :188.0  
#>  1st Qu.:189.0   1st Qu.:191.0   1st Qu.:193.0   1st Qu.:195.0  
#>  Median :193.0   Median :194.0   Median :196.0   Median :197.5  
#>  Mean   :191.9   Mean   :193.8   Mean   :195.5   Mean   :197.3  
#>  3rd Qu.:194.0   3rd Qu.:196.0   3rd Qu.:198.0   3rd Qu.:200.0  
#>  Max.   :203.0   Max.   :204.0   Max.   :205.0   Max.   :205.0  
#>  18 sites        19 sites        20 sites        21 sites       
#>  Min.   :188.0   Min.   :188.0   Min.   :190.0   Min.   :195.0  
#>  1st Qu.:196.8   1st Qu.:198.0   1st Qu.:199.0   1st Qu.:201.0  
#>  Median :199.0   Median :200.0   Median :202.0   Median :203.0  
#>  Mean   :198.9   Mean   :200.3   Mean   :201.7   Mean   :202.9  
#>  3rd Qu.:201.0   3rd Qu.:203.0   3rd Qu.:204.0   3rd Qu.:205.0  
#>  Max.   :208.0   Max.   :209.0   Max.   :210.0   Max.   :211.0  
#>  22 sites        23 sites        24 sites        25 sites       
#>  Min.   :195.0   Min.   :199.0   Min.   :199.0   Min.   :200.0  
#>  1st Qu.:202.0   1st Qu.:203.0   1st Qu.:204.0   1st Qu.:206.0  
#>  Median :204.0   Median :205.0   Median :207.0   Median :207.5  
#>  Mean   :204.2   Mean   :205.4   Mean   :206.7   Mean   :207.7  
#>  3rd Qu.:206.2   3rd Qu.:207.0   3rd Qu.:209.0   3rd Qu.:210.0  
#>  Max.   :214.0   Max.   :214.0   Max.   :214.0   Max.   :215.0  
#>  26 sites        27 sites        28 sites        29 sites       
#>  Min.   :203.0   Min.   :203.0   Min.   :204.0   Min.   :204.0  
#>  1st Qu.:207.0   1st Qu.:208.0   1st Qu.:209.0   1st Qu.:210.0  
#>  Median :209.0   Median :210.0   Median :211.0   Median :212.0  
#>  Mean   :208.9   Mean   :209.9   Mean   :210.9   Mean   :211.6  
#>  3rd Qu.:211.0   3rd Qu.:212.0   3rd Qu.:213.0   3rd Qu.:214.0  
#>  Max.   :217.0   Max.   :218.0   Max.   :220.0   Max.   :220.0  
#>  30 sites        31 sites        32 sites        33 sites       
#>  Min.   :206.0   Min.   :206.0   Min.   :206.0   Min.   :207.0  
#>  1st Qu.:211.0   1st Qu.:212.0   1st Qu.:213.0   1st Qu.:214.0  
#>  Median :212.5   Median :213.0   Median :214.0   Median :215.0  
#>  Mean   :212.7   Mean   :213.6   Mean   :214.4   Mean   :215.2  
#>  3rd Qu.:215.0   3rd Qu.:215.0   3rd Qu.:216.0   3rd Qu.:216.0  
#>  Max.   :221.0   Max.   :221.0   Max.   :222.0   Max.   :222.0  
#>  34 sites        35 sites        36 sites        37 sites       
#>  Min.   :208.0   Min.   :208.0   Min.   :208.0   Min.   :208.0  
#>  1st Qu.:214.0   1st Qu.:215.0   1st Qu.:216.0   1st Qu.:217.0  
#>  Median :216.0   Median :217.0   Median :218.0   Median :218.0  
#>  Mean   :215.9   Mean   :216.8   Mean   :217.5   Mean   :218.2  
#>  3rd Qu.:218.0   3rd Qu.:219.0   3rd Qu.:219.0   3rd Qu.:220.0  
#>  Max.   :222.0   Max.   :222.0   Max.   :223.0   Max.   :224.0  
#>  38 sites        39 sites        40 sites        41 sites       
#>  Min.   :212.0   Min.   :212.0   Min.   :212.0   Min.   :212.0  
#>  1st Qu.:217.0   1st Qu.:218.0   1st Qu.:219.0   1st Qu.:220.0  
#>  Median :219.0   Median :220.0   Median :220.0   Median :221.0  
#>  Mean   :219.0   Mean   :219.6   Mean   :220.1   Mean   :220.8  
#>  3rd Qu.:220.2   3rd Qu.:221.0   3rd Qu.:221.0   3rd Qu.:222.0  
#>  Max.   :225.0   Max.   :225.0   Max.   :225.0   Max.   :225.0  
#>  42 sites        43 sites        44 sites        45 sites       
#>  Min.   :215.0   Min.   :215.0   Min.   :218.0   Min.   :219.0  
#>  1st Qu.:220.0   1st Qu.:221.0   1st Qu.:221.0   1st Qu.:222.0  
#>  Median :221.0   Median :222.0   Median :222.0   Median :223.0  
#>  Mean   :221.3   Mean   :221.9   Mean   :222.3   Mean   :222.8  
#>  3rd Qu.:222.2   3rd Qu.:223.0   3rd Qu.:223.2   3rd Qu.:224.0  
#>  Max.   :225.0   Max.   :225.0   Max.   :225.0   Max.   :225.0  
#>  46 sites        47 sites        48 sites        49 sites        50 sites     
#>  Min.   :220.0   Min.   :221.0   Min.   :222.0   Min.   :223.0   Min.   :225  
#>  1st Qu.:222.8   1st Qu.:223.0   1st Qu.:224.0   1st Qu.:224.0   1st Qu.:225  
#>  Median :223.0   Median :224.0   Median :224.0   Median :225.0   Median :225  
#>  Mean   :223.3   Mean   :223.7   Mean   :224.1   Mean   :224.6   Mean   :225  
#>  3rd Qu.:224.0   3rd Qu.:225.0   3rd Qu.:225.0   3rd Qu.:225.0   3rd Qu.:225  
#>  Max.   :225.0   Max.   :225.0   Max.   :225.0   Max.   :225.0   Max.   :225  
plot(sp1, ci.type="poly", col="blue", lwd=2, ci.lty=0, ci.col="lightblue")
boxplot(sp2, col="yellow", add=TRUE, pch="+")

## Fit Lomolino model to the exact accumulation
mod1 <- fitspecaccum(sp1, "lomolino")
coef(mod1)
#>       Asym       xmid      slope 
#> 258.440682   2.442061   1.858694 
fitted(mod1)
#>  [1]  94.34749 121.23271 137.45031 148.83053 157.45735 164.31866 169.95946
#>  [8] 174.71115 178.78954 182.34254 185.47566 188.26658 190.77402 193.04337
#> [15] 195.11033 197.00350 198.74606 200.35705 201.85227 203.24499 204.54643
#> [22] 205.76612 206.91229 207.99203 209.01150 209.97609 210.89054 211.75903
#> [29] 212.58527 213.37256 214.12386 214.84180 215.52877 216.18692 216.81820
#> [36] 217.42437 218.00703 218.56767 219.10762 219.62811 220.13027 220.61514
#> [43] 221.08369 221.53679 221.97528 222.39991 222.81138 223.21037 223.59747
#> [50] 223.97327
plot(sp1)
## Add Lomolino model using argument 'add'
plot(mod1, add = TRUE, col=2, lwd=2)

## Fit Arrhenius models to all random accumulations
mods <- fitspecaccum(sp2, "arrh")
plot(mods, col="hotpink")
boxplot(sp2, col = "yellow", border = "blue", lty=1, cex=0.3, add= TRUE)

## Use nls() methods to the list of models
sapply(mods$models, AIC)
#>   [1] 329.2456 321.8614 331.1568 352.1309 354.8606 323.3767 322.0897 347.7218
#>   [9] 327.6283 327.3510 335.4843 308.5300 373.4959 334.3691 320.6975 338.1084
#>  [17] 330.2018 343.5560 348.5827 300.2513 315.7909 310.7837 305.5217 295.1005
#>  [25] 359.2639 342.7111 339.7456 328.4175 338.4335 368.4988 354.7097 328.8704
#>  [33] 342.1528 292.9875 328.3752 299.7201 336.5796 364.3153 336.4822 339.6666
#>  [41] 354.7445 320.7841 304.1628 314.9640 349.6753 350.7169 307.6840 296.7971
#>  [49] 359.6018 302.9863 319.6832 339.5021 328.8450 329.0553 298.0970 334.0182
#>  [57] 291.9027 349.7161 325.1376 347.7797 340.6111 338.6148 352.0292 308.8538
#>  [65] 315.1890 289.7947 351.6732 339.3587 320.3515 300.9377 323.3054 290.9419
#>  [73] 350.8587 322.6970 340.7948 334.1965 358.2890 300.7034 338.5079 338.8941
#>  [81] 341.7687 331.4553 337.5975 349.7867 331.8581 270.3068 354.5083 326.0026
#>  [89] 337.8555 322.7217 302.5019 324.7469 322.1415 324.6922 324.5427 347.2050
#>  [97] 309.1766 316.1194 343.9958 350.5935