analogue_distances: ggplot-based plot for analogue distance

View source: R/plot_analogue_distances.R

analogue_distancesR Documentation

ggplot-based plot for analogue distance

Description

Calculate and plot the distance to nearest analogue.

...

Usage

analogue_distances(spp, fos, df, x_axis, quantiles = c(0.05, 0.1), ...)

## S3 method for class 'analogue_distances'
autoplot(
  object,
  df,
  x_axis,
  fill = c("salmon", "lightyellow", "skyblue"),
  categories = c("Good", "Fair", "Poor"),
  ...
)

Arguments

spp

data.frame or matrix of calibration set species abundances

fos

data.frame or matrix of fossil species abundances

df

data.frame containing e.g. ages or depths of samples

x_axis

character; name of variable for x-axis. Defaults to sample number.

quantiles

numeric; quantiles of the training set residual lengths to plot

...

extra arguments to MAT. dist.method is the only relevant one.

object

analogue_distance object

fill

character; colours for the background fill for each quality categories

categories

character; names of residuals length quality categories.

Value

Returns a ggplot object.

Author(s)

Richard J. Telford

Examples

require("ggplot2")
data(ImbrieKipp, V12.122, package = "analogue")
## squared residual lengths for Core V12.122
AD <- analogue_distances(ImbrieKipp, V12.122)
autoplot(AD) +
 labs(y = "Squared-chord distance", x = "n")

richardjtelford/ggpalaeo documentation built on Nov. 7, 2022, 11:03 p.m.