pgls.wrap: A Wrapper for PGLS model

View source: R/reporting.R

pgls.wrapR Documentation

A Wrapper for PGLS model

Description

Print the results of an unfit PGLS model

Usage

pgls.wrap(cd,f,b,l,k,d,all.vars=names(cd$data)[-1], 
           model.no=NA, mtx.out=NA, write=TRUE,print=FALSE)

Arguments

cd

a 'comparative data' object, here created by 'comp.data(phylo, df, gs.clmn)'

f

the model formula (as acharacter string)

b

a list of vectors of upper and lower bounds for kappa, lambda, and delta

l

the fixed or 'ML' value for lambda

k

the fixed or 'ML' value for kappa

d

the fixed or 'ML' value for delta

all.vars

the names of all the variables to be reported

model.no

the model number (can be the order that models were run

mtx.out

should a matrix of the tabular summary results be returned

write

should the matrix of summary results be written to disk?

print

should the matrix of summary results be printed to screen?

Value

A matrix of summary results of a fit PGLS model

Examples


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")
#5. RAxML phylogram based on the 61199 bp concatenation of 69 nuclear and ten mitochondrial genes.
phyl <- ape::read.tree(tree.path)[[5]]

phyl <- trim.phylo(phylo=phyl, gs.vect=data$gn_sp)

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

model <- 'OC ~ mass.Kg + group.size'

pgls.wrap(cd=comp,f=model,b=list(kappa=c(.3,3),lambda=c(.3,3),delta=c(.3,3)), 
           l=1,k=1,d=1,all.vars=names(cd.obj$data)[-1])


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