Simplified version of my problem:
I have an OTU table with with 60 sample points (each with abundances for various OTUs) across three sites: A, B and C. Each site has 20 samples.
I want to plot rarefaction curves for each of the sites: A, B and C. I want to look to see if the curves for the sites plateau- to check if 'enough' sequences were sampled from each site.
At the moment I'm doing this:
raremax <- min(rowSums(otu.table))
rarecurve(otu.table, sample = raremax)
Currently every single sample point is being plotted as individual curves- this is not what I want- I want to plot the overall curves for each sampling site.
For the second option, you must sum the species counts by sites. This will ignore all differences among sampling units by sites (that some people call beta diversity), and treat sampling units as simple replicates. You may need to justify your approach to reviewers if you want to publish your results.
With standard R you can use
aggregate
to get the sums. The following example uses vegan data setsmite
andmite.env
:The
aggregate
will add one column that you must remove, and you will not have labels for the curves. A little bit more winding way gives you also the names:For this your data must be a
data.frame
--- matrix will fail.