comp.data: Comparative Data

View source: R/pgls.R

comp.dataR Documentation

Comparative Data

Description

This is a shortcut function that wraps around "comparative.data" for use in the PGLS function.

Usage

comp.data(phylo,df,gn_sp='gn_sp')

Arguments

phylo

a tre file of the format phylo

df

a data.frame with row names matching number and tip labels of 'tree'

gn_sp

the column name (e.g. "gn_sp") that indicates how to match df with tree

Value

a "comparative data" table for use in PGLS modeling

Examples


data.path <- system.file("extdata","primate-example.data.csv", package="mmodely")
data <- read.csv(data.path, row.names=1)
pvs <- names(data[3:5])
data$gn_sp <- rownames(data)

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

comp <- comp.data(phylo=phyl, df=data)



mmodely documentation built on May 31, 2023, 6:47 p.m.