autoplot.residLen: ggplot-based plot for objects of class "reslen"

View source: R/autoplot.residLen.R

autoplot.residLenR Documentation

ggplot-based plot for objects of class 'reslen'

Description

Produces a ggplot object representing the output of objects produced by residLen.

Usage

## S3 method for class 'residLen'
fortify(object, df)

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

Arguments

object

an object of class "residLen", the result of a call to residLen

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

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("analogue")
require("ggplot2")
data(ImbrieKipp, SumSST, V12.122, package = "analogue")
## squared residual lengths for Core V12.122
rlens <- residLen(ImbrieKipp, SumSST, V12.122)
autoplot(rlens, df = data.frame(age = as.numeric(rownames(V12.122))), x_axis = "age") +
labs(x = "Age", y = "Squared residual distance", fill = "Goodness of fit")

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