motmot.2.0 (version 1.1.2)

sortTraitData: Sort data and remove missing entries for tree and trait data

Description

Plots a phylogeny with lines representing the value of a continuous trait

Usage

sortTraitData(phy, y, log.trait = TRUE)

Arguments

phy

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

y

A matrix of trait values with taxon names as rownames. Missing values should be NA

log.trait

Logical. If TRUE, data are log-transformed

Value

phy Tree with missing data pruned

trait Rearranged data with missing species removed

Examples

Run this code
# NOT RUN {
data(anolis.tree)
data(anolis.data)
attach(anolis.data)
male.length <- matrix(Male_SVL, dimnames=list(rownames(anolis.data)))
any(is.na(male.length[,1]))
data.sorted <- sortTraitData(anolis.tree, male.length)
phy <- data.sorted[[1]]
male.length <- data.sorted[[2]]
# }

Run the code above in your browser using DataCamp Workspace