n2 | R Documentation |
Hills N2 is a measure of species diversity, commonly referred to as "effective" diversity. If computed on the rows (samples) then the "effective" number of species in each row is returned, whereas, if computed on the columns (species) then the "effective" number of occurences of each species in the data set is returned.
n2(x, ...)
## Default S3 method:
n2(x, which = c("species", "sites"), ...)
x |
matrix or data frame of species data |
which |
character; compute N2 on the rows ( |
... |
arguments passed to other methods |
A numeric vector of N2 values.
Gavin L. Simpson
data(swapdiat)
sppN2 <- n2(swapdiat, "species")
head(sppN2)
sampN2 <- n2(swapdiat, "sites")
head(sampN2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.