plot.minDC {analogue} | R Documentation |
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.
## 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",
...)
x |
an object of class |
depths |
numeric; a vector of depths for which predicted values
exist or will be generated. Can be missing, in which case,
if |
use.labels |
logical; should |
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 |
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 |
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 |
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
.
A plot on the currently active device.
Gavin L. Simpson
## 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.)")