View source: R/plot.dispRity.R
| plot.dispRity | R Documentation |
Plots a dispRity object.
## S3 method for class 'dispRity'
plot(
x,
...,
type,
quantiles = c(50, 95),
cent.tend = median,
rarefaction = NULL,
elements = FALSE,
observed = FALSE,
add = FALSE,
density = NULL,
specific.args
)
x |
A |
... |
Any optional arguments to be passed to |
type |
Either |
quantiles |
The quantiles to display (default is |
cent.tend |
A function for summarising the bootstrapped disparity values (default is |
rarefaction |
Either |
elements |
|
observed |
|
add |
|
density |
the density of shading lines to be passed to |
specific.args |
optional, a named list of arguments to be passed for some specific plot types. See details. |
When specifying optional arguments with ... in a graph with multiple elements (e.g. points, lines, etc...) you can specify which specific element to affect using the syntax <element>.<argument>. For example if you want everything in the plot to be in blue at the exception of the points to be red, you can use plot(..., col = "blue", points.col = "red").
The different type arguments are:
"continuous": plots the results as a continuous line.
"box": plots the results as discrete box plots (note that this option ignores the user set quantiles and central tendency).
"line": plots the results as discrete vertical lines with the user's set quantiles and central tendency.
"polygon": identical as "line" but using polygons rather than vertical lines.
"preview": plots two dimensional preview of the space (default is c(1,2)). WARNING: the plotted dimensions might not be representative of the full multi-dimensional space!
The different specific.args arguments for the following options are:
if type = "preview", the specific arguments can be:
dimensions: two specific dimensions to plot (default is specific.args = list(dimensions = c(1,2));
matrix: which specific matrix to plot the data from (by default, all the matrices are used).
tree: whether to plot the underlying tree(s) or not. Can be either logical, whether to plot no tree (default is specific.args = list(tree = FALSE)), all trees (specific.args = list(tree = TRUE)) or a specific set of trees (e.g. specific.args = list(tree = c(1,2)))
if data is a "test.metric" result that was obtained with the option save.steps = TRUE (see test.metric), it is possible to specify which steps to by specifying the following specific argument: specific.args = list(visualise.steps = c(1,4,5)) for visualising steps 1, 4 and 5 of the different shifts. By default, if the "test.metric" was obtained with the option save.steps = TRUE, four steps are displayed.
if data is a "dispRity" and "projection" object (from dispRity.covar.projections), it is possible to plot either the boxplot of disparity values for each projection (using correlation.plot = NULL; default) or to plot the correlation between two calculated elements (e.g. correlation.plot = c("position", "distance")).
When plotting "randtest" or "test.metric" data or when using type = "preview" a legend is plotted by default. To remove the legend you can use the argument legend = FALSE. You can control specific arguments for the legend using the ... optional arguments preceded by legend.. For example, to change the legend position you can use legend.x = "topleft" or legend.x = 4.2 and legend.y = 1.23. General legend arguments such as col, legend, pch, etc... are recycled by the function but can always be specified using this syntax.
Thomas Guillerme
dispRity, summary.dispRity, null.test, dtt.dispRity, model.test, model.test.sim, test.metric
## Load the disparity data based on Beck & Lee 2014
data(disparity)
## Discrete plotting
plot(disparity, type = "box")
## Using polygons rather than boxes (quantiles and central tendency can be
## set by the user)
plot(disparity, type = "polygon", quantiles = c(10, 50, 95),
cent.tend = mean)
## Using different options
plot(disparity, type = "line", elements = TRUE, ylim = c(0, 3),
xlab = ("Time (Ma)"), ylab = "disparity")
## Continuous plotting (all default options)
plot(disparity, type = "continuous")
## Rarefactions plots
plot(disparity, rarefaction = TRUE)
## Observed data
plot(disparity, observed = TRUE)
## Observed data with graphical details
plot(disparity, observed = list("pch" = 19, col = "blue", cex = 4))
## For plotting dispRity objects with the dual classes "randtest", "dtt",
## "model.test", "model.sim" and "test.metric" see the examples
## in the specific function manuals from the "See also" section above
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.