cor.par {PHENIX} | R Documentation |
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, silent=FALSE)
Arguments
traits |
a dataframe or a matrix object containing traits as columns and individuals as rows |
c.trait |
a vector containing the third control variable to estimate partial correlations, for instance: organ size or individual size |
trait.names |
a logical. 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 |
silent |
a logical. If 'FALSE' (default), return a warning message if any row contains missing data (and is removed from the original dataset before computation). |
Details
This function is utilised internally by pintsc
and pintsc.boot
to estimate the phenotypic integration index from partial correlations. Rows containing missing values are removed.
Value
A matrix with the pairwise partial correlation between traits.
Author(s)
R. Torices, A.J. Muñoz-Pajares
See Also
Examples
# Dataset from Torices & Méndez (2014)
# This data set represents the dry mass (in grams) 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)