calc.fun.div: Calculate functional diversity of the phenotypic or genotypic...

Description Usage Arguments Details Value Examples

View source: R/EndpointSummaryStats.R

Description

Implements the function [FD::dbFD()] from the package FD, for use on Pheno-Evo data. It calculates functional richness (FRic), functional evenness (FEve), functional divergence (FDiv), and functional dispersion (FDis). Please read the [FD::dbFD()] documentation for a more thorough explanation and references.

Usage

1
calc.fun.div(ends.df, trait)

Arguments

ends.df

Dataframe of endpoint data, generated by extract.endpoint(). Must contain individual-level data for the trait in question.

trait

Trait for which you want to calculate diversity. This must use same name as in column names of ends.df, and be enclosed in quotation marks.

Details

Note that not all diversity metrics are calculable for all datasets. You may get an error message warning you of metrics that can't be calculated for yours. Dataframes from timepoints other than the endpoint are also fine, as long as there is only 1 row per run number.

Value

A new dataframe that provides the values of four diversity metrics for each run number.

Examples

1
2
3
data(PhenoEvoData_small)
PE.ends_small<-extract.endpoint(PhenoEvoData_small, c(2, 4, 6))
calc.fun.div(PE.ends_small, trait='degrade.rate')

jessicaaudreylee/PhenoEvoR documentation built on Sept. 7, 2020, 3:50 a.m.