getStdAndMeanFunctions creates an average function multifunctionality index.

getStdAndMeanFunctions(data, vars, standardizeFunction = standardizeUnitScale)

Arguments

data

A data frame with functions.

vars

The column names of the functions to be assessed.

standardizeFunction

A function to standardize each individual function to the same scale, such as standardizeUnitScale or standardizeZScore

Value

Returns a data frame with standardized values for each function and an averaged index.

Details

iterates over all functions and standardizes them between 0 and 1. Then it creates an averaged multifunctionality index by averaging over all standardized functions

Author

Jarrett Byrnes.

Examples

data(all_biodepth)
allVars <- qw(biomassY3, root3, N.g.m2, light3, N.Soil, wood3, cotton3)

germany <- subset(all_biodepth, all_biodepth$location == "Germany")

vars <- whichVars(germany, allVars)

# re-normalize N.Soil so that everything is on the same
# sign-scale (e.g. the maximum level of a function is
# the "best" function)
germany$N.Soil <- -1 * germany$N.Soil + max(germany$N.Soil, na.rm = TRUE)

germany <- cbind(germany, getStdAndMeanFunctions(germany, vars))