# NOT RUN {
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)
germanyThresh <- getFuncMaxed(germany, vars,
thresh = 0.5,
prepend = c("plot", "Diversity"),
maxN = 7)
# A function that will return a data frame with the first several columns
# being information the user wants for identification purposes (prepend)
# which defaults to Diversity and the final column the number of columns
# which pass a predefined threshold, defined as some proportion of the maximim
# observed for each column. vars=the names of the vars being specified
# thresh is the threshold, between 0 and 1, of proportion of the max that needs
# to be passed to be counted.
# changelog
# 2014-03-24 Fixed -1 error in getMaxValue
# 2015-06-24 Fixed column name from prepend error https://github.com/jebyrnes/multifunc/issues/1
# 2022-04-14 Updated to use dplyr
# }
Run the code above in your browser using DataLab