plot.stackCalSPD: Plot a stack of SPDs

Description Usage Arguments References Examples

View source: R/plots.R

Description

Visualises multiple SPDs grouped as a stackCalSPD object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## 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,
  ...
)

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 SPDs should be rescaled to range 0 to 1. Default is FALSE.

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.

ylab

a title for the y axis

ymargin

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

...

Additional arguments affecting the plot.

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
data(emedyd)
emedyd = subset(emedyd,Region==1)
x = calibrate(x=emedyd$CRA, errors=emedyd$Error,normalised=FALSE)
bins = binPrep(sites=emedyd$SiteName, ages=emedyd$CRA,h=50)
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 Jan. 13, 2021, 7:09 p.m.