pgls.dispRity: phylolm dispRity (from 'phylolm::phylolm')

View source: R/pgls.dispRity.R

pgls.dispRityR Documentation

phylolm dispRity (from phylolm::phylolm)

Description

Passing dispRity objects to the phylolm function from the phylolm package. Typically to run some PGLS.

Usage

pgls.dispRity(data, tree, formula, model = "BM", ..., optim = list())

Arguments

data

A dispRity object with a metric of dimension level 2 at least

tree

If data does not contain a tree component, a "phylo" or "multiPhylo" object to be used as the tree. If data already contains a tree component and the tree argument is not missing, the provided tree will replace any contained in data.

formula

The PGLS formula. If left empty, runs either disparity ~ 1 or disparity ~ subsets if data contains subsets.

model

The covariance model (default is "BM"). For more details (including the models available) see the manual for phylolm.

...

Any optional arguments to be passed to phylolm

optim

An optional named list of arguments to be passed to the function optim

Details

The formula needs to be expressed by always naming the response variable disparity to use the calculated disparity data from data.

Optional arguments ... correspond to all the non-ambiguous named arguments from the phylolm. Optional arguments for the internal optim function can be passed as a named list to the optim argument.

Author(s)

Thomas Guillerme

See Also

phylolm, test.dispRity, custom.subsets, chrono.subsets.

Examples

## Simple example
data(BeckLee_mat50)
data(BeckLee_tree)
disparity <- dispRity(BeckLee_mat50, metric = centroids, tree = BeckLee_tree)

## Running a simple PGLS
model <- pgls.dispRity(disparity)
summary(model)

## More complex example running a PGLS
## on multiple trees and using groups as a predictor 


dispRity documentation built on May 29, 2024, 9:40 a.m.