Description Usage Arguments Details Note Author(s) References See Also Examples
View source: R/BioGeoBEARS_plots_v1.R
This function plots on a tree the highest-probability ancestral states (ranges), splits if desired (these are the ranges/states just after cladogenesis, and are plotted on the corners of a tree), and/or pie charts at nodes. A legend tying the relationship between colors and states/ranges is also optionally plotted.
1 2 3 4 5 6 7 8 | plot_BioGeoBEARS_results(results_object,
analysis_titletxt = NULL, addl_params = list(),
plotwhat = "text", label.offset = NULL, tipcex = 0.8,
statecex = 0.7, splitcex = 0.6, titlecex = 0.8,
plotsplits = TRUE, plotlegend = FALSE,
legend_ncol = NULL, legend_cex = 1,
cornercoords_loc = "manual", include_null_range = TRUE,
tr = NULL, tipranges = NULL)
|
results_object |
The results object from
|
analysis_titletxt |
The main title of the plot. If
NULL, |
addl_params |
The function will plot the log-likelihood (LnL) and the ML values of the free parameters. If you want additional parameters plotted, list them here. |
plotwhat |
To plot the ML discrete states, "text". To plot a piechart of the relative probability of all the states, "pie". |
label.offset |
Offset for the tree tip labels. If
|
tipcex |
|
statecex |
|
splitcex |
|
titlecex |
|
plotsplits |
If |
plotlegend |
If |
legend_ncol |
The number of columns in the legend.
If |
legend_cex |
The cex (character expansion size) for
the legend. Defaults to 1, which means the
|
cornercoords_loc |
The directory location containing
the R script |
include_null_range |
If |
tr |
Tree to plot on. Default |
tipranges |
Tip geography data. Default |
The legend is plotted on a separate plot, as it is very
difficult to predict whether or not there will be space
on any given tree plot. The utility of the legend is
also debatable, as plot_BioGeoBEARS_results
plots
the colors and state/range names directly onto the plot.
Any legend will get unwieldy above perhaps 32 states,
which is just 5 areas with no constraints (see
numstates_from_numareas
, or type
numstates_from_numareas(numareas5, maxareas5,
include_null_range=TRUE)
.
Note that this assumes that the ancestral states were
calculated under the global optimum model (rather than
the local optimum, with the model re-optimized for each
possible state at each possible node, as done in e.g.
LAGRANGE
), and that these are marginal
probabilities, i.e. this is not a joint reconstruction,
instead it gives the probabilities of states at each
node. This will not always be readable as a joint
reconstruction (it could depict split scenarios that are
not possible, for instance.)
Go BEARS!
Nicholas J. Matzke matzke@berkeley.edu
https://code.google.com/p/lagrange/
Matzke_2012_IBS
ReeSmith2008
get_leftright_nodes_matrix_from_results
,
corner_coords
,
plot.phylo
,
plot.phylo
,
tiplabels
,
legend
,
floor
, ceiling
,
floor
,
numstates_from_numareas
,
system.file
,
list.files
1 | test=1
|
Loading required package: rexpokit
Loading required package: SparseM
Attaching package: 'SparseM'
The following object is masked from 'package:base':
backsolve
Loading required package: Rcpp
Loading required package: cladoRcpp
Loading required package: ape
Loading required package: phylobase
Attaching package: 'phylobase'
The following object is masked from 'package:ape':
edges
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.