Search code examples
rveganstandardization

Rarefy my species data based on individuals


I am new to R so I apologize in advance. I sampled moths along an elevational gradient with a total of 8 different sites. I had unequal sampling nights per elevation. Because of my unequal sampling nights, I want to standardize my species by rarefying my species based on the individuals I got. I am confused about how to rarefy my species data. From the rarefy package (rarefy(x, sample, se = FALSE, MARGIN = 1), I don't understand how to specify my sample/subsample number. Is it going to be the minimum number of individuals I got from a site? Thank you very much


Solution

  • Yes, to account for uneven sampling you would typically rarefy to the minimum number of individuals you got from a site. Below is an example:

    library(vegan)
    data(BCI)
    # Your data should be organised like the BCI data - species in columns, sites in rows.
    
    # Use rowSums to find the minimum number found at a site:
    raremax <- min(rowSums(BCI))
    
    # Rarefy to that number
    rarefied_data <- rrarefy(BCI, raremax)
    

    This gives you a table in the same format (species x site) where all the rows sum to the same number.

    Note there are other ways to deal with uneven sampling, and some people think rarefying needlessly throws away data. The following papers are discussing microbial communities, but the arguments are still relevant for moths:

    https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1003531 https://www.biorxiv.org/content/10.1101/2020.09.09.290049v1.full