3 \title{Variance Components with Orthonormal Contrasts}
5 This function calls Phylip's contrast program and returns the
6 phylogenetic and phenotypic variance-covariance components for one or
7 several traits. There can be several observations per species.
10 varCompPhylip(x, phy, exec = NULL)
13 \item{x}{a numeric vector, a matrix (or data frame), or a list.}
14 \item{phy}{an object of class \code{"phylo"}.}
15 \item{exec}{a character string giving the name of the executable
16 contrast program (see details).}
19 The data \code{x} can be in several forms: (i) a numeric vector if
20 there is single trait and one observation per species; (ii) a
21 matrix or data frame if there are several traits (as columns) and a
22 single observation of each trait for each species; (iii) a list of
23 vectors if there is a single trait and several observations per
24 species; (iv) a list of matrices or data frames: same than (ii) but
25 with several traits and the rows are individuals.
27 If \code{x} has names, its values are matched to the tip labels of
28 \code{phy}, otherwise its values are taken to be in the same order
29 than the tip labels of \code{phy}.
31 Phylip (version 3.68 or higher) must be accessible on your computer. If
32 you have a Unix-like operating system, the executable name is assumed
33 to be \code{"phylip contrast"} (as in Debian); otherwise it is set
34 to \code{"contrast"}. If this doesn't suit your system, use the
35 option \code{exec} accordingly. If the executable is not in the path, you
36 may need to specify it, e.g., \code{exec = "C:/Program Files/Phylip/contrast"}.
39 a list with elements \code{varA} and \code{varE} with the phylogenetic
40 (additive) and phenotypic (environmental) variance-covariance
41 matrices. If a single trait is analyzed, these contains its variances.
44 Felsenstein, J. (2004) Phylip (Phylogeny Inference Package) version
45 3.68. Department of Genetics, University of Washington, Seattle, USA.
46 \url{http://evolution.genetics.washington.edu/phylip/phylip.html}.
48 Felsenstein, J. (2008) Comparative methods with sampling error and
49 within-species variation: Contrasts revisited and revised.
50 \emph{American Naturalist}, \bold{171}, 713--725.
52 \author{Emmanuel Paradis}
54 \code{\link{pic}}, \code{\link{pic.ortho}}, \code{\link{compar.lynch}}
59 ### Five traits, one observation per species:
60 x <- replicate(5, rTraitCont(tr, sigma = 1))
61 varCompPhylip(x, tr) # varE is small
62 x <- replicate(5, rnorm(30))
63 varCompPhylip(x, tr) # varE is large
64 ### Five traits, ten observations per species:
65 x <- replicate(30, replicate(5, rnorm(10)), simplify = FALSE)