rdpi: rdpi

View source: R/RDPI.R

rdpiR Documentation

rdpi

Description

Function to compute the RDPI (Relative Distance Plasticity Index, Valladares et al, (2006) Quantitative estimation of phenotypic plasticity: bridging the gap between the evolutionary concept and its ecological applications, Journal of Ecology, 94(6):1103-1116.

Usage

rdpi(dataframe, sp, trait, factor)

Arguments

dataframe

The dataframe that contains the data

sp

The bare (unquoted) name of the column whose values will be used as independent variable. The function will compare RDPI values among values of this variable. It can be species, provenances, etc.

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

This function computes RDPI to the environmental factor for each species of the dataset(or any other identifying variable defined in 'sp') Then it makes an ANOVA or t-test of the values of RDPI across species and plots the boxplot

Examples

data(ecophysio)
rdpi(ecophysio,sp,SB, Piso)

# if we want to store the values

foo <- rdpi(ecophysio,sp,SB, Piso)

ameztegui/Plasticity documentation built on Feb. 1, 2024, 5:36 p.m.