rescaleRR: Rescaling phylogenetic trees

View source: R/rescaleRR.R

rescaleRRR Documentation

Rescaling phylogenetic trees

Description

The function rescales all branches and leaves of the phylogenetic tree.

Usage

rescaleRR(tree,RR=NULL,height=NULL,trend=NULL,delta=NULL,kappa=NULL,lambda=NULL)

Arguments

tree

the phylogenetic tree to be rescaled.

RR

is the output of RRphylo performed on tree. If this parameter is indicated, the tree branches are rescaled according to branch-wise phenotypic evolutionary rates fitted by RRphylo. When a multivariate phenotype is used, rescaling is operated on the norm-2 vector of rates.

height

is the desired height of the tree. If this parameter is indicated, the tree branches are rescaled to match the total height.

trend

is a diffusion model with linear trend in rates through time. The trend scaling is largely based on package geiger's rescale.phylo function.

delta

if this parameter is indicated, the tree is rescaled according to Pagel's delta transform (Pagel 1999). Nodes are pushed toward the present for values of delta ranging between 0 and 1. The converse applies for delta larger than 1. Negative delta values are not allowed.

kappa

if this parameter is indicated, the tree is rescaled according to Pagel's kappa transform (Pagel 1999). At kappa = 1 the tree is left unmodified. Branches become increasingly closer to 1 as kappa approaches 0, making evolution independent from branch lengths. Negative kappa values are not allowed.

lambda

if this parameter is indicated, the tree is rescaled according to Pagel's lambda transform (Pagel 1999). At lambda = 1 the tree is left unmodified. The tree approaches a star phylogeny as lambda approaches zero. lambda values larger than one are undefined Negative lambda values are not allowed.

Value

Rescaled phylogenetic tree.

Author(s)

Silvia Castiglione, Pasquale Raia

References

Castiglione, S., Serio, C., Piccolo, M., Mondanaro, A., Melchionna, M., Di Febbraro, M., Sansalone, G., Wroe, S., & Raia, P. (2020). The influence of domestication, insularity and sociality on the tempo and mode of brain size evolution in mammals. Biological Journal of the Linnean Society,132: 221-231. doi:10.1093/biolinnean/blaa186

Pagel, M. (1999). Inferring the historical patterns of biological evolution. Nature, 401:877-884.

Examples

## Not run: 
ape::rtree(100)->tree
phytools::fastBM(tree)->y
max(diag(vcv(tree)))->H

RRphylo(tree,y,clus=0)->RR
rescaleRR(tree,RR=RR)->treeRR

rescaleRR(tree,height=H/3)->tree_height

rescaleRR(tree,trend=5)->tree_trend

rescaleRR(tree,delta=0.5)->tree_delta05
rescaleRR(tree,delta=2)->tree_delta2

rescaleRR(tree,kappa=0.5)->tree_kappa

rescaleRR(tree,lambda=0.5)->tree_lambda

## End(Not run)

RRphylo documentation built on June 7, 2023, 5:49 p.m.