flux.age.ghost: plot flux rates for proxies

View source: R/accrate.R

flux.age.ghostR Documentation

plot flux rates for proxies

Description

Plot grey-scale representation of estimated flux rates for proxies against calendar age.

Usage

flux.age.ghost(
  column = 1,
  flux = c(),
  set = get("info"),
  coredir = set$coredir,
  remove.hiatuses = TRUE,
  age.lab = c(),
  age.lim = c(),
  age.rev = FALSE,
  age.res = 500,
  age.compress = -0.01,
  flux.lim = c(),
  flux.rev = FALSE,
  flux.lab = "flux (proxy/yr)",
  flux.res = 500,
  BCAD = set$BCAD,
  prob = 0.95,
  clip.prob = 0.99,
  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,
  flux.cols = col.scales(256, "white", "black", darkest = darkest),
  dark = 0.9,
  darkest = 1,
  rotate.axes = FALSE,
  use.raster = FALSE,
  xaxs = "i",
  yaxs = "i",
  bty = "l"
)

Arguments

column

Which proxy to use (counting from the column number in the .csv file after the depths column).

flux

Instead of using a file, the data can also be provided as a variable. The first column should be the depths, and the variable 'column' should indicate which column (after the depth column) contains the proxy of interest. For example, if using Plum we could produce a greyscale of the mass accumulation rate: myflux <- info$detsPlum[,c(4,6)];

set

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

coredir

Folder where the core's files core are and/or will be located. This will be a folder with the core's name, within either the folder coredir='Bacon_runs/', or the folder Cores/ if it already exists within R's working directory, or a custom-built folder. For example, use coredir="." to place the core's folder within the current working directory, or coredir="F:" if you want to put the core's folder and files on a USB drive loaded under F:.

remove.hiatuses

Hiatuses will affect apparent accumulation rates within sections. Therefore, by default the hiatus jumps will be removed from the accumulation rates within sections containing hiatuses.

age.lab

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

age.lim

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

age.rev

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

age.res

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

age.compress

Since the bottom and top edges of age-models often show weird flux behaviour, the top and bottom half are shaved off by default (1%, age.compress=-0.01).

flux.lim

Limits of the flux axes.

flux.rev

The flux axis can be reversed with flux.rev=TRUE.

flux.lab

Axis labels. Defaults to flux.lab="flux".

flux.res

Resolution or amount of greyscale pixels to cover the flux scale of the plot. Default flux.res=500.

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.

prob

Probability for the flux ranges; defaults to prob=0.95.

clip.prob

Since some iterations show very high flux values, it is useful to clip the top values. Defaults to clip.prob=0.975.

plot.range

Plot curves that indicate a probability range.

range.col

Grey seems nice (default range.col=grey(0.5)).

range.lty

Line type of the flux ranges. Defaults to dashed, range.lty=2.

plot.mean

Plot the mean fluxes. Default TRUE.

mean.col

Red seems nice.

mean.lty

Line type of the means. Defaults to dashed, range.lty=2.

plot.median

Plot the median fluxes. Default TRUE

median.col

Blue seems nice.

median.lty

Line type of the medians. Defaults to dashed, range.lty=2.

flux.cols

Colour of the flux ghost graph. Defaults to greyscales, flux.cols=gray.colors(256, start=darkest, end=0).

dark

Any (normalised) flux value above this threshold is set to the threshold; default is dark=0.9.

darkest

The darkest value. Set to 1 for the darkest colour to be black if using a greyscale.

rotate.axes

The default of plotting calendar year on the horizontal axis and fluxes on the vertical one can be changed with rotate.axes=TRUE.

use.raster

Rasters can be aligned or not in the underlying image function. By default, we use use.raster=FALSE. This takes a bit longer to draw and sometimes causes strange lines owing to anti-aliasing.

xaxs

Limits of the horizontal axis. By default does not extend, xaxs="i".

yaxs

Limits of the vertical axis. By default does not extend, yaxs="i".

bty

Type of box to plot around the graph. Defaults to L-shaped, bty="l".

Details

To plot flux rates (e.g. pollen grains/cm2/yr) as greyscales, provide a plain text file with headers and the data in columns separated by commas, ending in '_flux.csv' and saved in your core's folder. The first column should contain the depths, and the next columns should contain the proxy concentration values (leaving missing values empty). Then type for example flux.age.ghost(1) to plot the flux values for the first proxy in the .csv file. Instead of using a _flux.csv file, a flux variable can also be defined within the R session (consisting of depths and their proxy concentrations in two columns). Then provide the name of this variable, e.g.: flux.age.ghost(flux=flux1). See Bacon_runs/MSB2K/MSB2K_flux.csv for an example.

Value

A plot of flux rates, and the underlying greyscales, means, medians and ranges (invisibly).

Author(s)

Maarten Blaauw, J. Andres Christen

Examples

## Not run: 
  Bacon(run=FALSE, coredir=tempfile())
  agedepth(yr.res=50)
  flux.age.ghost(1)

## End(Not run)

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