plot_acc: Plot accumulation rate

View source: R/utils-plot.R

plot_accR Documentation

Plot accumulation rate

Description

Plot accumulation rate prior and posterior.

Usage

plot_acc(
  K,
  output,
  acc.mean = 20,
  acc.shape = 1.5,
  thick = 5,
  hiatuses = NULL,
  plot = TRUE,
  xlab = "Acc. rate [yr/cm]",
  ylab = NULL,
  title = NULL,
  ...
)

Arguments

K

Number of sections in the core.

output

Last MCMC output.

acc.mean

The accumulation rate prior consists of a gamma distribution with two parameters. Its mean is set by acc.mean (default acc.mean=20 yr/cm (or whatever age or depth units are chosen), which can be changed to, e.g., 5, 10 or 50 for different kinds of deposits). Multiple values can be given in case of hiatuses or boundaries, e.g., Bacon(hiatus.depths=23, acc.mean=c(5,20)).

acc.shape

The prior for the accumulation rate consists of a gamma distribution with two parameters. Its shape is set by acc.shape (default acc.shape=1.5; higher values result in more peaked shapes).

thick

Bacon will divide the core into sections of equal thickness specified by thick (default thick = 5).

hiatuses

Data frame containing information of hiatuses.

plot

Boolean flag to indicate whether a plot should be generated or just return a data frame with posterior and prior values.

xlab

x-axis label.

ylab

y-axis label.

title

Plot title.

...

Optional parameters for ggplot2::stat_function.

Value

List with ggplot2 object and data frame with posterior and prior values.

Examples

## Not run: 
out <- read.table("Bacon_runs/core/core_K.out")
plot_acc(out$K, out$output)

## End(Not run)


special-uor/ageR documentation built on July 10, 2024, 10:08 p.m.