Learn R Programming

PHENIX (version 1.0)

cor.par: Partial correlation

Description

This function calculates the partial correlation matrix between a set of traits and a third control variable.

Usage

cor.par(traits, c.trait, trait.names = FALSE)

Arguments

traits
a dataframe or a matrix object with all your traits in which columns are the traits and rows are the individuals
c.trait
a vector containing the third control variable to estimate partial correlations, for instance: the size of the organ or the individual
trait.names
a logical (default=FALSE): If 'FALSE' (default), trait names in the output are defined as "Trait 1", "Trait 2", ..., "Trait n". If 'TRUE', output trait names are the same than those in the input dataframe

Value

  • A matrix with the pairwise partial correlation between traits.

Details

This function is utilised internally by intsc and intsc.boot to estimate the phenotypic integration index from partial correlations. Rows containing missing values are removed.

See Also

pcor, pcor.test

Examples

Run this code
# Dataset from Torices & Méndez (2014)
# This data set represents the dry mass (in grames) of inflorescence components of the sunflower
# species Tussilago farfara. The inflorescences were dissected in 'SCAPE', 'RECEPTACLE', 'MALEFL'
# (male flowers), 'OVAR' (reproductive part of female flowers), and 'RAYS' (the petaloid ray of
# female flower). Furthermore in the last column the total weight of the inflorescence is added
# 'TOTALSIZE'

data(tussilago)
print(tussilago)
cor.par(tussilago[,1:5], tussilago[,6], trait.names=TRUE) # NA automatically removed

traits<-na.exclude(tussilago) # NA manually removed
cor.par(traits[,1:5], traits[,6], trait.names=TRUE)

Run the code above in your browser using DataLab