rescaleSimmap: Rescale object of class '"simmap"'

View source: R/utilities.R

rescale.simmapR Documentation

Rescale object of class "simmap"

Description

Scales a tree with a mapped discrete character ("simmap" object), or a set of such trees, to an arbitrary total height, preserving the relative time spent in each state along each edge.

Usage

## S3 method for class 'simmap'
rescale(x, model="depth", ...)
## S3 method for class 'multiSimmap'
rescale(x, model="depth", ...)
rescaleSimmap(tree, ...)

Arguments

x

object of class "simmap" or "multiSimmap" to be rescaled.

model

model to use to rescale the tree. Currently the only option is "depth".

...

parameter of the model to use in rescaling. Currently the only parameter is depth for model="depth".

tree

for rescaleSimmap, object of class "simmap" to be rescaled.

Details

Replaces rescaleTree (now rescale.phylo) in the geiger package for the "simmap" object class. rescaleSimmap is now a redundant alias for the method rescale.simmap.

Value

An object of class "simmap" or "multiSimmap".

Author(s)

Liam Revell liam.revell@umb.edu

References

Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.

See Also

make.simmap, read.simmap

Examples

## load anoletree
data(anoletree)
## rescale to have total depth of 50
rescaled_anoletree<-rescale(anoletree,depth=50)
## plot rescaled tree
plot(rescaled_anoletree,ftype="i",fsize=0.6,
	mar=c(5.1,1.1,1.1,1.1))
axis(1,at=seq(0,50,by=10))
par(mar=c(5.1,4.1,4.1,2.1)) ## reset margin to default

liamrevell/phytools documentation built on March 4, 2024, 3:27 a.m.