rdpi_matrix: rdpi_matrix

rdpi_matrixR Documentation

rdpi_matrix

Description

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.

Usage

rdpi_matrix(data, trait, factor)

rdpi_matrix(data, trait, factor)

Arguments

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.

Value

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"

Examples

data(ecophysio)
compute_rdpi(ecophysio,SB, Stage)
data(ecophysio)
rdpi_matrix(ecophysio,SB, Stage)

ameztegui/Plasticity documentation built on Oct. 16, 2024, 2:02 p.m.