dat4MLM2TE_obj: Utility function dat4MLM2TE_obj

View source: R/dat4MLM2TE_obj.r

dat4MLM2TE_objR Documentation

Utility function dat4MLM2TE_obj

Description

dat4MLM2TE_obj creates from data in a format for glm(m)/MLM a TE_obj object (see make_obj_for_traitenv), which consists of trait, environment and abundance data. The argument dat is usually created using expand4glmm. The function is used repeatedly in MLM3_p_max.

Usage

dat4MLM2TE_obj(dat, cutoff = 0)

Arguments

dat

dataframe with names y, site, species, trait and env for values of abundance, identity of site and of species and the trait value and environmental value, respectively.

cutoff

minimal number of occurrences of species

Details

The order of data in dat should be in standard order, that is, first all data on species 1, then species 2, with all sites listed in identical order for each species (including zero abundances). BEWARE: The function currently works for a single trait and environmental variable only!!!!

Value

An object of class TE_obj

References

ter Braak (2019) New robust weighted averaging- and model-based methods for assessing trait-environment relationships. Methods in Ecology and Evolution (https://doi.org/10.1111/2041-210X.13278)

Examples

## Not run: 
data("Revisit")
str(Revisit)
TE_obj <- dat4MLM2TE_obj(Revisit)
str(TE_obj)

## End(Not run)

CajoterBraak/TraitEnvMLMWA documentation built on Jan. 25, 2023, 7:36 p.m.