View source: R/species_diversity.R
species_diversity | R Documentation |
Calculate the diversity of species for the following indexes: Shannon, Simpson, Equitability, Pielou and Jentsch.
species_diversity(df, species, plot = NA, NI_label = "", index = "all")
df |
A data frame. |
species |
Quoted name of the scientific names variable, or any variable used to differentiate the different species found in data. If supplied, will be used to classify the species in the diameter data. |
plot |
Optional parameter. Quoted name of the plot variable. used to differentiate the plots, and calculate the indexes by plot, or other subdivision variable. |
NI_label |
Label used for Species not identified. This parameter works along with species. The level supplied here will not be considered in the classification. Default |
index |
Character value for the desired index to be used. Can be either |
a data frame with the indexes, or a numeric value of the desired index specified in the index argument.
Eric Bastos Gorgens e.gorgens@gmail.com
Souza, A. L. and Soares, C. P. B. (2013) Florestas Nativas: estrutura, dinamica e manejo. Vicosa: UFV.
library(forestmangr)
data("exfm20")
head(exfm20)
# By default, the function returns all indexes:
species_diversity(exfm20, "scientific.name")
# It's possible to use a subdivision variable, like plot, to get
# the indexes for each subdivision:
species_diversity(exfm20, "scientific.name", "transect")
# To only get one specific index, use the index argument:
species_diversity(exfm20, "scientific.name", index = "H")
species_diversity(exfm20, "scientific.name", index = "S")
species_diversity(exfm20, "scientific.name", index = "Hmax")
species_diversity(exfm20, "scientific.name", index = "J")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.