make_local_trait_ktab: Create a subsetted KTab

Description Usage Arguments Details Value Note Author(s) See Also

View source: R/Local_KTab.R

Description

A wrapper around functions from ade4 to create the specialized data structure known as a ktab. These are used in subsequent functions to calculate a generalized Gower distance based on the methods of Pavoine et al 2009.

Usage

1
make_local_trait_ktab(focal.species, community.data, trait.data, traits)

Arguments

focal.species

The focal species or plot identifier that you want to use to create a the phylogeny

community.data

The community data file. Each observation of a species in a community should be its own row. For now, the column specifiy which community is which is called exotic_species, but this will be generalized later using an argument to specifiy which column marks community separators and which column holds the actual species names

trait.data

A data frame that contains trait data information. Currently, this only supports names from Levin et al 2017, but will hopefully soon be generalized to include all trait names listed in TRY (Kattge et al 2017).

traits

A character vector of trait names that should match the names in trait.data. An effect method of subsetting this is to simply call names(trait.data)[first.trait:last.trait]

Details

ade4 provides many useful functions for calculating trait based distances. The aim of this particular function is to create an easy-to-automate version of these for use in stepwise model selection procedures which can handle odd boundary cases not necessarily forseen in previous implementations. This particular function makes it easy to loop across a variety of traits without having to stop and figure out which type of variable each particular portion of the ktab is. The VarType output is designed to seamlessly integrate with dist.ktab's type argument to allow for effortless integration.

Value

A list consisting of

Note

The output from this function is designed to be passed directly to make_local_trait_dist.

Author(s)

Sam Levin

See Also

make_local_trait_dist, make_regional_trait_ktab


levisc8/Fun_Phylo_Package documentation built on June 2, 2020, 8:41 a.m.