Sergey Bolshakov
Sergey Bolshakov

Reputation: 21

How I can plot a expected richness curve (Chao1) via vegan in R

I have a dataset from one site containing data on species and its abundance (number of individuals for each species in sample). I use vegan package for alpha diversity analysis. For instance, I plot a species rarefraction curve via rarecurve function (I cann't use a specaccum function becouse I have data from one site), and calculate a Chao1 index via estimateR function.

How I can plot a Chao1 expected richness curve using estimateR function? Then, I would like to combine these curves on one single plot.

library(vegan)
TR <- matrix(nrow=1,c(3,1,1,17,1,1,1,1,1,2,1,1,3,13,31,24,6,1,1,4,1,10,2,3,1,5,6,1,1,1,4,16,17,15,6,9,66,3,1,3,24,15,2,3,17,1,7,2,27,13,2,1,1,3,1,3,30,7,1,1,4,1,2,5,1,1,6,2,1,9,11,5,8,7,2,2,2,1,13,3,8,4,1,5,27,1,62,13,6,7,7,4,9,1,7,7,1,25,1,5,3,1,2,1,1,5,2,73,25,17,43,88,2,3,38,4,5,6,6,16,2,13,10,7,1,2,9,3,1,3,1,8,4,4,5,13,2,25,9,2,1,12,29,4,1,9,1,1,3,4,2,9,4,26,2,7,4,18,1,10,10,4,6,5,20,1,2,11,1,3,1,2,1,1,12,3,2,1,4,24,7,22,19,43,2,9,18,1,1,1,9,7,6,1,8,2,2,19,7,26,4,4,1,3,4,5,2,4,8,2,3,1,5,5,1,11,6,6,2,4,3,1,10,6,9,16,1,1,32,1,1,31,2,12,2,13,1,2,9,13,1,11,8,1,14,5,9,1,3,1,7,1,1,13,17,1,1,3,2,9,1,4,1,7,2,2,9,24,20,2,1,2,2,1,9,5,1,1,23,13,7,1,8,5,47,32,6,13,16,8,2,1,5,4,3,1,2,1,1,1,3,14,6,21,2,7,2,2,16,2,10,21,18,2,1,3,33,12,55,4,1,5,14,3,10,2,4,1,2,5,7,6,2,12,14,28,18,30,28,7,1,1,1,3,4,2,17,60,31,3,3,2,2,3,6,2,6,1,13,2,3,13,7,2,10,19,9,7,1,3))
num_species=specnumber(TR)
chao1=estimateR(TR)[2,]
shannon=diversity(TR,"shannon")
rarecurve(TR)
estimateR(TR)

Here is a plot, building on EstimateS output (I input the same data) with SigmaPlot:

Individual-based species accumulation curve (SAC) (thick line) and the Chao 1 estimator (thin line) of expected richness;

Thin line is expected richness - Chao1. In R I can plot only SAC. In EstimateS I get a set with data for all 2990 individuals, but not in R.

Upvotes: 2

Views: 3162

Answers (1)

Jari Oksanen
Jari Oksanen

Reputation: 3682

I don't know how things are done in estimateS, but it looks like the extended richness (Chao 1) curve is based on the mean of random subsamples of the community. This could be done like this:

subchao <- sapply(1:2990, function(i) 
   mean(sapply(1:100, function(...) estimateR(rrarefy(TR, i))[2,])))

This would randomly rarefy (rrarefy()) to all sample sizes from 1 to 2990 and find the mean from 100 replicates of each. This will take time.

Upvotes: 2

Related Questions