rdpi_matrix | R Documentation |
Function to compute a vector containing the relative distance plasticity index values (Valladares et al. 2006) of a given trait (trait) for a given categorical environmental variable (factor). It calculates rdpi for each pair of observation that does not belong to the same level of "factor", and returns a vector containing all the calculated rdpi values.
Function to compute a matrix with the relative distance plasticity index values (Valladares et al. 2006) of a given trait (trait) for a given categorical environmental variable (factor). It calculates rdpi for each pair of observation that does not belong to the same level of "factor", and returns a vector containing all the calculated rdpi values.
rdpi_matrix(data, trait, factor)
rdpi_matrix(data, trait, factor)
data |
The dataframe that contains the data |
trait |
The bare (unquoted) name of the column that holds the trait for which to calculate RDPI. Must be numeric |
factor |
the bare (unquoted) name of the column that holds the environmental factor for which we will calculate RDPI. By definition, RDPI computes distances between pairs of observations that are at different levels of this factor. |
a vector containing all the calculated rdpi values for each pair of observations that do not belong to the same level of "factor"
a vector containing all the calculated rdpi values for each pair of observations that do not belong to the same level of "factor"
data(ecophysio)
compute_rdpi(ecophysio,SB, Stage)
data(ecophysio)
rdpi_matrix(ecophysio,SB, Stage)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.