Learn R Programming

phangorn (version 1.2-0)

designTree: Compute a design matrix

Description

designTree and designSplits compute design matrices for the estimation of edge length of (phylogenetic) trees using linear models. designTree also computes a contrast matrix if the method is "rooted".

Usage

designTree(tree, method = "unrooted", ...)
designSplits(x, splits = "all", ...)

Arguments

tree
an object of class phylo
method
design matrix for an "unrooted" or "rooted" ultrametric tree
x
number of taxa.
splits
one of "all", "star"
...
further arguments, passed to other methods.

Value

  • a matrix.

See Also

fastme, distanceHadamard

Examples

Run this code
example(NJ)
dm <-  as.matrix(dm)
y <- dm[lower.tri(dm)]
X <- designTree(tree)
summary(lm(y~X-1))

Run the code above in your browser using DataLab