PlotCharacterMapping | R Documentation |
Plot a tree depicting a character reconstruction
PlotCharacterMapping(
char,
stateLabels,
singleTree,
legendText = "",
SetPar = par(mar = rep(0.2, 4), cex = 0.7),
canvas = NULL,
treeNames = NULL,
analysisLabels = canvas$analysisNames,
charIndex = character(0),
svgFilename = "tree_%s.svg"
)
char |
Character vector specifying distribution of tokens among (named) taxa |
stateLabels |
Character vector specifying the labels to apply to each state |
singleTree |
A single tree to be plotted in Latex output |
legendText |
Character giving legend text to print in Latex output |
SetPar |
Graphical parameters to set before plotting PNG tree
in Latex output. Specify |
canvas |
an object of class SVGForest. |
treeNames |
Character string naming the analysis used to generate each tree |
analysisLabels |
Character vector specifying names of each analysis, to be printed on plot |
charIndex |
Character vector providing a reference for the character,
typically its number, to be sent to |
svgFilename |
Character string specifying location to save each file,
containing the expression |
This function will plot a reconstruction of the distribution of character char
on a set of phylogenetic trees.
The function is intended for use in R Markdown (.Rmd
) documents, which might
be rendered using the knitr
, rmarkdown
or bookdown
pacakges.
These packages can produce output in PDF or HTML format; this package will
generate SVG files for HTML output, and a static PNG otherwise.
The SVG output will generate a separate plot for each tree in canvas
;
JavaScript can be specified using PrintSwitcher()
or
PrintJavascript()
in order
to allow the user to switch between trees. Due to the space considerations
implicit in PDF documents, the PNG images include only a single tree,
specified by singleTree
.
HTML output can be forced by setting options('localInstance' = TRUE)
.
Prints the tree in an appropriate markdown format
Martin R. Smith
# An example is given in the help page for SVGCanvas; type ?SVGCanvas
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.