R/inverse_simpson.R

Defines functions inverse_simpson

Documented in inverse_simpson

#' Get alpha diversity using inverse simpson
#'
#' @param x A list of counts
#' @return A single value
#'
#' @examples
#' inverse_simpson(seq_len(10))
#'
#' @export


# x: Species count vector
inverse_simpson <- function(x) {

    # Simpson index
    lambda <- simpson_index(x)

    # Inverse Simpson diversity
    (1/lambda)

}
hiplot/animalcules documentation built on March 1, 2021, 12:04 a.m.