plot.dispRity: dispRity object plotting

View source: R/plot.dispRity.R

plot.dispRityR Documentation

dispRity object plotting


Plots a dispRity object.


## S3 method for class 'dispRity'
  quantiles = c(50, 95),
  cent.tend = median,
  rarefaction = NULL,
  elements = FALSE,
  observed = FALSE,
  add = FALSE,
  density = NULL,



A dispRity object.


Any optional arguments to be passed to plot. See details.


Either "continuous", "box", "line", "polygon" or "space". When unspecified, if no disparity was calculated, "preview" is used. If disparity was calculated, "continuous" is used for chrono.subsets and "box" for custom.subsets. See details.


The quantiles to display (default is quantiles = c(50, 95); is ignored if the dispRity object is not bootstrapped).


A function for summarising the bootstrapped disparity values (default is median).


Either NULL (default) or FALSE for not using the rarefaction scores; a numeric value of the level of rarefaction to plot; or TRUE for plotting the rarefaction curves.


logical whether to plot the number of elements per subsets (default is FALSE) or a list of any of the graphical arguments "col", "pch" and/or "cex".


logical whether to add the observed values on the plot as crosses (default is FALSE) or a list of any of the graphical arguments "col", "pch" and/or "cex".


logical whether to add the new plot an existing one (default is FALSE).


the density of shading lines to be passed to polygon. Is ignored if type = "box" or type = "line".


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

See Also

dispRity, summary.dispRity, null.test, dtt.dispRity, model.test, model.test.sim, test.metric


## Load the disparity data based on Beck & Lee 2014

## 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

dispRity documentation built on May 29, 2024, 9:40 a.m.