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

Description Usage Arguments Value Author(s) Examples

View source: R/autoplot.residLen.R

Description

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

Usage

1
2
3
4
5
6
7
## 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

1
2
3
4
5
6
7
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 Dec. 7, 2018, 7:55 a.m.