Learn R Programming

ume (version 1.5.2)

calc_pielou_evenness: Calculate Pielou's Evenness

Description

This function calculates Pielou's evenness index, a measure of the distribution of abundances across molecular formulas. Evenness ranges from 0 (one molecular formula dominates) to 1 (all formulas are equally abundant).

Evenness is derived using the Shannon index: $$E = \frac{H}{\log(S)}$$ where:

  • \(H\) is the Shannon diversity index.

  • \(S\) is the number of unique molecular formulas.

If there is only one molecular formula, evenness is defined as 1.

Usage

calc_pielou_evenness(mf, magnitude)

Value

A single numeric value representing Pielou's evenness.

Arguments

mf

Character vector. A list of unique molecular formulas.

magnitude

Numeric vector. A list of respective intensities (abundances) for each molecular formula. Must be non-negative and have the same length as mf.

Examples

Run this code
calc_pielou_evenness(
  mf = c("C10H20O5", "C12H18O3", "C18H30O6"),
  magnitude = c(1982375, 2424, 312410)
)

Run the code above in your browser using DataLab