plotRR function

Plot the RRphylo output onto the phylogenetic tree

Plot the RRphylo output onto the phylogenetic tree

This function generates customized functions to plot the phylogenetic tree (as returned by RRphylo) with branches colored according to phenotypic values or phenotypic evolutionary rates.

plotRR(RR,y,multivariate=NULL)

Arguments

  • RR: an object produced by RRphylo.
  • y: the vector/matrix of phenotypic values used to perform RRphylo.
  • multivariate: if RRphylo was performed on multivariate data, this argument indicates whether individual rates for each variables (= "multiple.rates") or the norm2 vector of multivariate rates (= "rates") should be plotted.

Returns

The function returns a list of functions:

plotRRphenchartsphenotypicvaluesalongthetreebranches.Phenotypesattipsaretakenastheyarefromtheyobject.PhenotypicvaluesforinternalbranchesarederivedfromtheRRplotRRphen charts phenotypic values along the tree branches. Phenotypes at tips are taken as they are from the `y` object. Phenotypic values for internal branches are derived from the `RRaces`

object. The usage is: ...$plotRRphen(variable=NULL,tree.args=NULL,color.pal=NULL,colorbar.args=list()), where variable is the index or name of the variable to be plotted in case of multivariate data, tree.args is a list of further arguments passed to the function plot.phylo plus a logical indicating whether the tree should be ladderized before plotting (see examples below), color.pal is a function to generate the color palette, and colorbar.args is a list of further arguments passed to the function colorbar (if = NULL the bar is not plotted).

plotRRrateschartsevolutionaryratevaluesalongthetreebranches.TheusageisidenticaltoplotRRrates charts evolutionary rate values along the tree branches. The usage is identical to `plotRRphen. In case of multivariate data and multivariate = "rates", the argument variable` can be left unspecified.

Examples

## Not run: data("DataApes") DataApes$PCstage->PCstage DataApes$Tstage->Tstage cc<- 2/parallel::detectCores() RRphylo(tree=Tstage,y=PCstage,clus=cc)->RRstage plotRR(RRstage,y=PCstage,multivariate="multiple.rates")->pRR1 pRR1$plotRRphen(variable=1,tree.args=list(edge.width=2),color.pal=rainbow, colorbar.args = list(x="bottomleft",labs.adj=0.7,xpd=TRUE)) pRR1$plotRRrates(variable=2,tree.args=list(edge.width=2,direction="leftwards",ladderize=TRUE), color.pal=rainbow,colorbar.args = list(x="topright",labs.adj=0.7,xpd=TRUE)) plotRR(RRstage,y=PCstage,multivariate="rates")->pRR2 pRR2$plotRRrates(tree.args=list(edge.width=2), color.pal=hcl.colors, colorbar.args = list(x="topleft",labs.adj=0.7,xpd=TRUE,title.pos="bottom")) ## End(Not run)

See Also

c("list("RRphylo")", " vignette")

c("list("plotRR")", " vignette")

c("list("RRphylo")", " vignette")

c("list("plotRR")", " vignette")

Author(s)

Silvia Castiglione, Pasquale Raia

  • Maintainer: Silvia Castiglione
  • License: GPL-2
  • Last published: 2025-03-23

Useful links