accrate.age.ghost: plot a core's accumulation rates against calendar time

View source: R/accrate.R

accrate.age.ghostR Documentation

plot a core's accumulation rates against calendar time

Description

Plot a grey-scale representation of a core's estimated accumulation rates against time.

Usage

accrate.age.ghost(
  set = get("info"),
  age.lim = c(),
  age.lab = c(),
  na.rm = TRUE,
  kcal = FALSE,
  age.res = 400,
  acc.res = 200,
  cutoff = 0.001,
  zero.col = "white",
  max.col = "black",
  dark = 1,
  darkest = 1,
  rgb.scale = c(0, 0, 0),
  rgb.res = 100,
  prob = 0.95,
  plot.range = TRUE,
  range.col = grey(0.5),
  range.lty = 2,
  plot.mean = TRUE,
  mean.col = "red",
  mean.lty = 2,
  plot.median = TRUE,
  median.col = "blue",
  median.lty = 2,
  acc.lim = c(),
  acc.lab = c(),
  BCAD = set$BCAD,
  cmyr = FALSE,
  rotate.axes = FALSE,
  rev.age = FALSE,
  rev.acc = FALSE,
  use.raster = FALSE,
  flip.acc = FALSE,
  flip.age = FALSE,
  xaxs = "i",
  yaxs = "i",
  bty = "l"
)

Arguments

set

Detailed information of the current run, stored within this session's memory as variable info.

age.lim

Minimum and maximum calendar age ranges, calculated automatically by default (age.lim=c()).

age.lab

The labels for the calendar axis (default age.lab="cal BP" or "BC/AD" if BCAD=TRUE).

na.rm

Remove NA entries. These are NOT removed by default, ensuring that always the same amount of iterations is returned.

kcal

Use kcal BP. Default is kcal=FALSE.

age.res

Resolution or amount of greyscale pixels to cover the age scale of the plot. Default age.res=400.

acc.res

Resolution or amount of greyscale pixels to cover the accumulation rate scale plot. Default age.res=400.

cutoff

Point below which colours will no longer be printed. Default cutoff=0.001.

zero.col

The colour where the ghost is 0. Defaults to zero.col="white", which together with max.col="black" results in a greyscale. More creative colour gradients can be implemented by checking the 600+ colours in colours().

max.col

The colour where the ghost is at its maximum. Defaults to max.col="black", which together with zero.col="white" results in a greyscale. More creative colour gradients can be implemented by checking the 600+ colours in colours().

dark

The value beyond which any higher values will be clipped. Set to 1 by default. This can be set to lower values if for example only a very small area in the plot obtains the darkest values - then lowering the 'dark' value will darker a larger area.

darkest

The darkest grey value is darkest=1 by default; lower values will result in lighter maximum colours; values >1 are not advised.

rgb.scale

The function to produce a coloured representation of all age-models. Needs 3 values for the intensity of red, green and blue. Defaults to grey-scales: rgb.scale=c(0,0,0), but could also be, say, scales of red (rgb.scale=c(1,0,0)).

rgb.res

Resolution of the colour spectrum depicting the age-depth model. Default rgb.res=100.

prob

Probability ranges. Defaults to prob=0.95.

plot.range

If plot.range=TRUE, the confidence ranges (two-tailed; half of the probability at each side) are plotted.

range.col

Colour of the confidence ranges.

range.lty

Line type of the confidence ranges.

plot.mean

If plot.mean=TRUE, the means are plotted.

mean.col

Colour of the mean accumulation rates.

mean.lty

Type of the mean lines.

plot.median

If plot.mean=TRUE, the medians are plotted.

median.col

Colour of the median accumulation rates.

median.lty

Type of the median lines.

acc.lim

Axis limits for the accumulation rates.

acc.lab

Axis label for the accumulation rate.

BCAD

The calendar scale of graphs and age output-files is in cal BP by default, but can be changed to BC/AD using BCAD=TRUE.

cmyr

Accumulation rates can be calculated in cm/year or year/cm. By default cmyr=FALSE and accumulation rates are calculated in year per cm. Axis limits are difficult to calculate when cmyr=TRUE, so a manual adaptation of acc.lim might be a good idea.

rotate.axes

The default is to plot the calendar age horizontally and accumulation rates vertically. Change to rotate.axes=TRUE value to rotate axes.

rev.age

The direction of the age axis, which can be reversed using rev.age=TRUE.

rev.acc

The direction of the accumulation rate axis, which can be reversed (rev.acc=TRUE.

use.raster

Rasters can be aligned or not in the underlying image function. Setting use.raster=FALSE takes a bit longer to draw and sometimes causes strange lines owing to anti-aliasing. Therefore, use.raster=TRUE is the default, however on some devices (e.g., Mac OS quartz) this causes greyscales to 'flip'. If this is the case, use 'flip.acc=TRUE'.

flip.acc

When using use.raster=TRUE, sometimes greyscales are flipped. If this is the case, see if setting flip.acc=TRUE solves this.

flip.age

When using use.raster=TRUE, sometimes greyscales are flipped. If this is the case, see if setting flip.age=TRUE solves this.

xaxs

Extension of the x-axis. White space can be added to the vertical axis using xaxs="r".

yaxs

Extension of the y-axis. White space can be added to the vertical axis using yaxs="r".

bty

Type of box to be drawn around the plot ("n" for none, and "l" (default), "7", "c", "u", or "o" for correspondingly shaped boxes).

Details

Calculating accumulation rates against calendar age will take some time to calculate, and might show unexpected rates around the core's maximum ages (only a few of all age-model iterations will reach such ages and they will tend to have modelled accumulation rates for the lower depths much lower than the other iterations). Axis limits for accumulation rates are estimated automatically, however upper limits can be very variable (and thus hard to predict) if calculated in cm/yr. Therefore you might want to manually adapt the axis limits after plotting with default settings (e.g., acc.lim=c(0,1)). See also accrate.depth.ghost, accrate.depth and accrate.age. The grey-scale reconstruction around the oldest ages of any reconstruction often indicates very low accumulation rates. This is due to only some MCMC iterations reaching those old ages, and these iterations will have modelled very slow accumulation rates. Currently does not deal well with hiatuses, so do not interpret accumulation rates close to depths with inferred hiatuses. If warning messages such as "In min(x) : no non-missing arguments to min; returning Inf" appear, Bacon likely became confused about whether or not to use BC/AD. Best run your core again with the desired setting for BCAD.

Value

A greyscale plot of accumulation rate against calendar age, and (invisibly) the list of ages and their accumulation rates (ranges, medians, means).

Author(s)

Maarten Blaauw, J. Andres Christen

Examples

## Not run: 
  Bacon(run=FALSE, coredir=tempfile())
  agedepth(age.res=20, d.res=20, d.by=10)
  layout(1)
  tmp <- accrate.age.ghost(age.res=200, acc.res=100)
  head(tmp)

## End(Not run)

rbacon documentation built on Oct. 22, 2026, 5:21 p.m.