reconPlot {analogue}R Documentation

Stratigraphic plots of palaeoenvironmental reconstructions


Draws a palaeoenvironmental reconstruction of predicted environmental values for sub-fossil assemblages.


reconPlot(x, ...)

## Default S3 method:
reconPlot(x, depths, errors,
          display.error = c("none", "bars", "lines"),
          rev.x = TRUE,
          col.error = "grey", lty.error = "dashed",
          type = "l",
          xlim, ylim,
          xlab = "", ylab = "", main = "",

## S3 method for class 'predict.mat'
reconPlot(x, depths, use.labels = FALSE,
          predictions = c("model", "bootstrap"),
          display.error = c("none", "bars", "lines"),
          sample.specific = TRUE, ...)

## S3 method for class 'predict.wa'
reconPlot(x, depths, use.labels = FALSE,
          display.error = c("none", "bars", "lines"),
          sample.specific = TRUE, ...)



An R object.


numeric; a vector of depths for which predicted values exist or will be generated. Can be missing, in which case, if use.labels = TRUE, the function will attempt to derive suitable values for you. See Details below.


numeric; a vector of errors for plotting error bars or lines.


character; hown should error bars be drawn on the plot? One of "none", "bars", or "lines". If "bars", error bars are drawn for each sample. If "lines", lines are drawn enclosing the region prediction +/- RMSEP.


logical; should the depth/age axis be reversed (drawn from high to low)?

col.error, lty.error

the colour and type of line drawn. See par and arguments "col" and "lty".


type of line drawn. See par and argument "type".

xlab, ylab

character; the x- and y-axis labels respectively.


character; main title for the plot.

xlim, ylim

numeric, length 2; the x- and y-limits for the plotted axes. If not provided, the function will calculate appropriate values to cover the range of plotted values and any error bars (if requested via "error.bars".


logical; should reconPlot attempt to derive values for argument depths from the names of the predicted values? Only use if depths is missing. See Details below.


character; one of "model" or "bootstrap". Which type of predicted values should be plotted? The model predictions ("model") or the bootstrap-derived predictions ("bootstrap").


logical; should sample specific errors be used? Only for predictions = "bootstrap".


arguments passed to other graphics functions.


Conventionally, these plots are drawn on a depth or an age scale. Argument depths is used to provide the depth or age axis, against which the predicted values are plotted.

If depths is not provided, then the function will try to derive the appropriate values from the labels of the predictions if use.labels = TRUE. You must provide depths or set use.labels = TRUE otherwise an error will result. The derived labels will be coerced to numerics. If your labels are not coercible, then you'll either get nonsense on the plot or an error from R. If so, provide suitable values for depths.


A plot on the currently active device.


Gavin L. Simpson

See Also

mat, and predict.mat for MAT transfer functions and wa and predict.wa for WA models.


## Imbrie and Kipp example
## load the example data

## merge training and test set on columns
dat <- join(ImbrieKipp, V12.122, verbose = TRUE)

## extract the merged data sets and convert to proportions
ImbrieKipp <- dat[[1]] / 100
V12.122 <- dat[[2]] / 100

## Fit a MAT model
(ik.mat <- mat(ImbrieKipp, SumSST, method = "chord"))

## Reconstruct pH for the RLGH core
v12.pH <- predict(ik.mat, V12.122)

## draw the reconstruction
reconPlot(v12.pH, use.labels = TRUE, display.error = "bars",
          xlab = "Depth", ylab = "Summer Seas-surface Temperature")

[Package analogue version 0.17-6 Index]