powered by
This function calculates the Index of Shannon (1948) for a tibble with different species.
The formula that is used is $$SI = -\sum_{S=1}^i (p_i * ln(p_i))$$ where \(p_i\) is the relative abundance of each species (\(S\)).
shannon_index(var_tibble)
double of the Shannon Index
a tibble with two columns (name of species, count per species), the second column must be called "count"
shannon1948SoilManageR
spellerberg2003tributeSoilManageR
plant_diversity() to calculate the shannon_index() (and other diversity indices) for a management_df
plant_diversity()
shannon_index()
#create tibble tibble_example <- tibble::tibble(Plant = c("A","B","C","D","E"), count = c(10,5,8,20,10)) #calculate Shannon Index shannon_index(tibble_example) # = 1.505...
Run the code above in your browser using DataLab