as.rateMatrix {motmot} | R Documentation |
Conversion among data and phylogeny objects
Description
Function to generate a rateMatrix
object containing a set of variance covariance matrices.
Note that as.rateMatrix
calls the CAIC function vcv.array
multiple times and this can be slow for large phylogenies (though faster than using the ape equivalent vcv.phylo
).
Usage
as.rateMatrix(phy, x, data)
Arguments
phy |
An object of class "phylo" (see ape). |
x |
The explanatory (discrete) variable used to define the hypothesised rate categories. Can be specified as a column number or column name |
data |
The explanatory (discrete) variable used to define the hypothesised rate categories. Can be specified as a column number or column name |
Value
rateMatrix An object of class "rateMatrix" - a list of matrices describing the expected variances and covariances of between species. Each matrix refers to the variances and covariances for a given state of x (see Thomas et al. 2006).
Author(s)
Gavin Thomas
References
Thomas GH, Freckleton RP, & Szekely T. 2006. Comparative analyses of the influence of developmental mode on phenotypic diversification rates in shorebirds. Proceedings of the Royal Society B 273, 1619-1624.
Examples
## Read in phylogeny and data from Thomas et al. (2009)
data(anolis.tree)
data(anolis.data)
## Convert data to class rateMatrix
anolis.rateMatrix <- as.rateMatrix(phy=anolis.tree, x="geo_ecomorph", data=anolis.data)