as.rateMatrix: Conversion among data and phylogeny objects

Description Usage Arguments Value Author(s) References Examples

View source: R/as.rateMatrix.R

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

1

Arguments

phy

An object of class "phylo" (see ape package).

x

The explanatory (discrete) variable used to define the hypothesised rate categories. Can be specified as a column number or column name.

data

A data frame containing (minimally) the x variable as a column with species names as rownames.

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

1
2
3
4
5
6
7
## Read in phylogeny and data from Thomas et al. (2009)
data(anolis.tree)
data(anolis.data)

## Convert data to class rateMatrix
# Not run
# anolis.rateMatrix <- as.rateMatrix(phy=anolis.tree, x="geo_ecomorph", data=anolis.data)

motmot documentation built on May 2, 2019, 4:48 p.m.