gower_traits | R Documentation |
Creates dummy variables for multi-level factor/character traits, binary variables for bi-level factor/character traits and scales all variables by their range. Furthermore this function supplies weights, which are inversely proportional to the number of dummy variables created for a given trait.
gower_traits(x, hasNames = F, NA.tolerance = 0.25)
x |
numeric matrix. Species-trait matrix. |
hasNames |
a logical. Does the first column contain species names/codes? |
NA.tolerance |
a number between 0 and 1. Subset species which have a lower proportion of missing traits than 'NA.tolerance'. |
a list which includes the transformed trait table and the weights for each column in the table.
This functions performs automatic transformations of a trait-matrix/-table, to "Gower variables". This means that the variables are appropriate for usage in Gower Dissimilarity calculations, without further transformations. Combined with the weights, which are also automatically calculated, and in conjunction with the function "gowerDissimilarity" (also found in this package), this makes the calculation of diverse Gower Dissimilarities for all other purposes than pairwise dissimilarities, much easier than what was previously available in R.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.