plot.stackCalSPD: Plot a stack of SPDs

View source: R/plots.R

plot.stackCalSPDR Documentation

Plot a stack of SPDs

Description

Visualises multiple SPDs grouped as a stackCalSPD object.

Usage

## S3 method for class 'stackCalSPD'
plot(
  x,
  type = "stacked",
  calendar = "BP",
  spdnormalised = FALSE,
  rescale = FALSE,
  runm = NA,
  xlim = NA,
  ylim = NA,
  xaxt = "s",
  yaxt = "s",
  gapFactor = 0.2,
  col.fill = NA,
  col.line = NA,
  lwd.obs = 1,
  lty.obs = 1,
  cex.lab = 1,
  cex.axis = cex.lab,
  legend = TRUE,
  legend.arg = NULL,
  ylab = NA,
  ymargin = 1.1,
  rnd = 2,
  ...
)

Arguments

x

A stackCalSPD class object. Result of stackspd function.

type

How to display the SPDs.Current options are 'stacked','lines', ''proportion'. and 'multipanel'. Default is 'stacked'.

calendar

Either 'BP' or 'BCAD'. Indicate whether the calibrated date should be displayed in BP or BC/AD. Default is 'BP'.

spdnormalised

A logical variable indicating whether the total probability mass of the SPDs are normalised to sum to unity. Default is FALSE.

rescale

A logical variable indicating whether the summed probabilities values should be rescaled to range 0 to 1. Default is FALSE.Notice that this is different from setting spdnormalised to TRUE.

runm

A number indicating the window size of the moving average to smooth the SPD. If set to NA no moving average is applied. Default is NA

xlim

the x limits of the plot. In BP or in BC/AD depending on the choice of the parameter calender. Notice that if BC/AD is selected BC ages should have a minus sign (e.g. c(-5000,200) for 5000 BC to 200 AD).

ylim

the y limits of the plot.

xaxt

Whether the x-axis tick marks should be displayed (xaxt='s', default) or not (xaxt='n').

yaxt

Whether the y-axis tick marks should be displayed (xaxt='s', default) or not (xaxt='n').

gapFactor

Defines spacing between SPDs as proportion of the y-axis range for multipanel plots. Default is 0.2.

col.fill

Vector of fill color for the observed SPDs. The default color scheme is based on the Dark2 pallette of RColorBrewer package.

col.line

Line colour for the observed SPDs.The default color scheme is based on the Dark2 palette of RColorBrewer package.

lwd.obs

Line width for the observed SPDs. Default is 1.

lty.obs

Line type for the observed SPDs. Default is 1.

cex.lab

The magnification to be used for x and y labels relative to the current setting of cex. Default is adjusted to 1.

cex.axis

The magnification to be used for axis annotation relative to the current setting of cex. Default is adjusted to 1.

legend

Whether legend needs to be displayed. Item names will be retrieved from the values supplied in the argument group in stackspd. Default is TRUE.

legend.arg

list of additional arguments to pass to legend; names of the list are used as argument names. Only used if legend is set to TRUE. If supplied legend position must be given (e.g. legend.arg=list(x='bottomright').

ylab

a title for the y axis

ymargin

multiplier for the maximum value on ylim range. Default is 1.1.

rnd

integer indicating the number of decimal places to be displayed in the y-axis for when type is set "multitype".

...

Additional arguments affecting the plot.

Details

The display order of the SPDs is given by the factor levels of the user-supplied group argument in the stackspd() function.

References

Erich Neuwirth (2014). RColorBrewer: ColorBrewer Palettes. R package version 1.1-2. https://CRAN.R-project.org/package=RColorBrewer.

Examples

## Not run: 
data(emedyd)
x = calibrate(x=emedyd$CRA, errors=emedyd$Error,normalised=FALSE)
bins = binPrep(sites=emedyd$SiteName, ages=emedyd$CRA,h=100)
res = stackspd(x=x,timeRange=c(16000,8000),bins=bins,group=emedyd$Region)
plot(res,type='stacked')
plot(res,type='lines')
plot(res,type='proportion')
plot(res,type='multipanel')

## End(Not run)

rcarbon documentation built on Aug. 24, 2023, 5:11 p.m.