Learn R Programming

mmodely (version 0.2.5)

get.phylo.stats: Get tree statistics for a trait

Description

This function uses Pagel's lambda, Blombergs k, and Ancestral Character Estimation [ACE] to calculate statistics on a tree given a specified trait.

Usage

get.phylo.stats(phylo, data, trait.clmn, gs.clmn='gn_sp', 
                ace.method='REML',ace.scaled=TRUE, ace.kappa=1)

Value

statistics on a particular trait within a tree (Pagel's lambda, Blomberg's k, and the most ancestral ACE estimate)

Arguments

phylo

PARAMDESCRIPTION

data

PARAMDESCRIPTION

trait.clmn

PARAMDESCRIPTION

gs.clmn

PARAMDESCRIPTION

ace.method

PARAMDESCRIPTION

ace.scaled

PARAMDESCRIPTION

ace.kappa

PARAMDESCRIPTION

Examples

Run this code

data.path <- system.file("extdata","primate-example.data.csv", package="mmodely")
data <- read.csv(data.path, row.names=1)

data$gn_sp <- rownames(data)

tree.path <- system.file("extdata","primate-springer.2012.tre", package="mmodely")
phyl <- ape::read.tree(tree.path)[[5]]

get.phylo.stats(phylo=phyl, data=data, trait.clmn='OC', 
        gs.clmn='gn_sp', ace.method='REML',ace.scaled=TRUE, ace.kappa=1)

Run the code above in your browser using DataLab