plotRR | R Documentation |
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)
RR |
an object produced by |
y |
the vector/matrix of phenotypic values used to perform
|
multivariate |
if |
The function returns a list of functions:
$plotRRphen 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 RR$aces
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
, 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).
$plotRRrates 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.
Silvia Castiglione, Pasquale Raia
## Not run:
data("DataApes")
DataApes$PCstage->PCstage
DataApes$Tstage->Tstage
cc<- 2/parallel::detectCores()
RRphylo(tree=Tstage,y=PCstage,clus=cc)->RR
plotRR(RR,y=PCstage,multivariate="multiple.rates")->pRR
pRR$plotRRphen(variable=1,tree.args=list(edge.width=2),color.pal=rainbow,
colorbar.args = list(x="bottomleft",labs.adj=0.7,xpd=TRUE))
pRR$plotRRrates(variable=2,tree.args=list(edge.width=2,direction="leftwards"),
color.pal=rainbow,colorbar.args = list(x="topright",labs.adj=0.7,xpd=TRUE))
plotRR(RR,y=PCstage,multivariate="rates")->pRR
pRR$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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.