Learn R Programming

dispRity (version 1.5.0)

plot.dispRity: dispRity object plotting

Description

Plots a dispRity object.

Usage

# S3 method for dispRity
plot(
  x,
  ...,
  type,
  quantiles = c(50, 95),
  cent.tend = median,
  rarefaction = NULL,
  elements = FALSE,
  observed = FALSE,
  add = FALSE,
  density = NULL,
  specific.args
)

Arguments

x

A dispRity object.

...

Any optional arguments to be passed to plot.

type

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.

quantiles

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

cent.tend

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

rarefaction

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.

elements

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".

observed

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".

add

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

density

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

specific.args

optional, a named list of arguments to be passed for some specific plot types. See details.

Details

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 default is specific.args = list(dimensions = c(1,2), matrix = 1) where dimensions designates which dimensions to plot and matrix which specific matrix from data to plot.

  • for plots with legends (if type = "preview"; if data is "randtest" or "test.metric") you can pass any non ambiguous arguments for legend such as specific.args = list(legend = list(x = 1, y = 2, bg = "blue")). When the plot generates two legends (e.g. when the data is "test.metric"), these arguments can be a list (e.g. specific.args = list(legend = list(list(x = "bottomright"), list(x = "topright"))). HINT: to remove the legends all together you can use specific.args = list(legend = FALSE).

See Also

dispRity, summary.dispRity.

Examples

Run this code
# NOT RUN {
## 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))

# }

Run the code above in your browser using DataLab