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.