plot.minDC: Plot of minimum dissimilarity per sample

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/minDC.R

Description

Minimum dissimilarity is a useful indicator of reliability of reconstructions performed via MAT and other methods, and for analogue matching. Minimum dissimilarity for a sample is the smallest dissimilarity between it and the training set samples.

Usage

1
2
3
4
5
6
7
## S3 method for class 'minDC'
plot(x, depths, use.labels = FALSE,
           quantiles = TRUE, rev.x = TRUE, type = "l",
           xlim, ylim, xlab = "", ylab = "Dissimilarity",
           main = "", sub = NULL,
           col.quantile = "red", lty.quantile = "dotted",
           ...)

Arguments

x

an object of class "minDC".

depths

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.

use.labels

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.

quantiles

logical; should the probability quantiles be drawn on the plot?

rev.x

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

type

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

xlab, ylab

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

main, sub

character; main title and subtitle 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 quantile lines (if requested via "quantiles".

col.quantile

colour in which to draw the quantile lines.

lty.quantile

line type in which to draw the quantile lines.

...

arguments to be passed to methods, such as graphical parameters (see par). Currently ignored.

Details

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 coercible, then you'll either get nonsense on the plot or an error from R. If so, provide suitable values for depths.

Value

A plot on the currently active device.

Author(s)

Gavin L. Simpson

See Also

minDC

Examples

 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
## Imbrie and Kipp example
## load the example data
data(ImbrieKipp)
data(SumSST)
data(V12.122)

## 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 the MAT model using the chord distance measure
(ik.mat <- mat(ImbrieKipp, SumSST, method = "chord"))

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

## extract the minimum DC values
v12.mdc <- minDC(v12.mat)
v12.mdc

## draw a plot of minimum DC by time
plot(v12.mdc, use.labels = TRUE, xlab = "Depth (cm.)")

gavinsimpson/analogue documentation built on June 17, 2021, 2:37 a.m.