Learn R Programming

phytools (version 2.1-1)

rescale.simmap: 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 simmap
rescale(x, model="depth", ...)
# S3 method for multiSimmap
rescale(x, model="depth", ...)
rescaleSimmap(tree, ...)

Value

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

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.

Author

Liam Revell liam.revell@umb.edu

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.

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

Run this code
## 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

Run the code above in your browser using DataLab