Skip to contents

[Deprecated]

This function was deprecated, please use estimate_roc().

Usage

fc_estimate_RoC(
  data_source_community,
  data_source_age,
  age_uncertainty = NULL,
  smooth_method = c("none", "m.avg", "grim", "age.w", "shep"),
  smooth_n_points = 5,
  smooth_N_points = lifecycle::deprecated(),
  smooth_age_range = 500,
  smooth_n_max = 9,
  smooth_N_max = lifecycle::deprecated(),
  working_units = c("levels", "bins", "MW"),
  Working_Units = lifecycle::deprecated(),
  bin_size = 500,
  number_of_shifts = 5,
  Number_of_shifts = lifecycle::deprecated(),
  bin_selection = c("random", "first"),
  standardise = FALSE,
  n_individuals = 150,
  N_individuals = lifecycle::deprecated(),
  dissimilarity_coefficient = c("euc", "euc.sd", "chord", "chisq", "gower", "bray"),
  DC = lifecycle::deprecated(),
  tranform_to_proportions = TRUE,
  rand = NULL,
  use_parallel = FALSE,
  interest_threshold = NULL,
  time_standardisation = NULL,
  verbose = FALSE
)

Arguments

data_source_community

data.frame. Community data with taxa as columns and samples as rows. The first column must be named sample_id (character).

data_source_age

data.frame with two columns:

  • sample_id - unique identifier of each level (character)

  • age - age of the level (numeric)

age_uncertainty

Optional age-uncertainty matrix from an age-depth model. Either:

  • A matrix with one column per sample and one row per age sequence drawn from a posterior age-depth model. One row is randomly selected at the start of each randomisation run. Used only when rand is set; with rand = NULL, the single run uses the point ages.

  • NULL (default) - age uncertainties are not used.

smooth_method

character. Smoothing method applied to each taxon before RoC is computed.

  • "none" - no smoothing (default)

  • "shep" - Shepard's 5-term filter (Davis, 1986; Wilkinson, 2005)

  • "m.avg" - moving average

  • "age.w" - age-weighted average

  • "grim" - Grimm's smoothing (Grimm & Jacobson, 1992). The window of each sample starts with the smooth_n_points samples centred on it, except that the windows of the first (smooth_n_max - 1) / 2 samples start at the first sample (with the defaults, the window of sample 4 starts with samples 1 to 6). It widens by one sample on each side at a time, in at most smooth_n_max - smooth_n_points steps, while it spans less than smooth_age_range years and has at most smooth_n_max samples. Windows near the ends of the sequence can therefore stay smaller than smooth_n_max. The window is not always centred on its sample, and neighbouring samples can end up with the same window. Their smoothed values are then identical, and the RoC between them is zero.

smooth_n_points

numeric. Number of samples in the window of moving average and age-weighted smoothing, and in the starting window of Grimm smoothing: the sample and (smooth_n_points - 1) / 2 samples on each side (for Grimm, see the exception at the start of the sequence under smooth_method). Near the ends of the sequence, the window is cut at the first or last sample and holds fewer samples. Must be a positive, odd whole number. Shepard's filter always uses the sample and two samples on each side; for it, smooth_n_points (a whole number greater than 2) only sets how many samples at each end of the sequence are left unsmoothed: smooth_n_points / 2, rounded to the nearest whole number with halves rounded to the even number (2 for 3 to 5, 4 for 7 to 9).

smooth_N_points

[Deprecated] smooth_N_points is no longer supported; please use smooth_n_points

smooth_age_range

numeric. Maximum age range (in years) for Grimm and age-weighted smoothing windows.

smooth_n_max

numeric. Maximum number of samples included in a Grimm smoothing window. Must be an odd whole number larger than smooth_n_points.

smooth_N_max

[Deprecated] smooth_N_max is no longer supported; please use smooth_n_max

working_units

character. Strategy used to define Working Units between which dissimilarity is calculated.

  • "levels" - each stratigraphical level is its own WU.

  • "bins" - one representative level is selected from each time bin of width bin_size.

  • "MW" - moving-window binning: selective binning is repeated number_of_shifts times, shifting the window by bin_size / number_of_shifts years each time. All results are retained and summarised together.

Working_Units

[Deprecated] Working_Units is no longer supported; please use working_units

bin_size

numeric. Width of each time bin in years. Used when working_units is "bins" or "MW".

number_of_shifts

numeric. Number of window shifts in moving-window binning (working_units = "MW").

Number_of_shifts

[Deprecated] Number_of_shifts is no longer supported; please use number_of_shifts

bin_selection

character. Rule for selecting one level from each bin.

  • "random" (default) - a level is selected at random.

  • "first" - the level closest to the start of the bin is selected.

standardise

logical. If TRUE, assemblage counts in each WU are rarefied to n_individuals before dissimilarity is computed.

n_individuals

numeric. Number of individuals to rarefy to when standardise = TRUE. Automatically reduced to the smallest count in the sequence if any WU has fewer individuals.

N_individuals

[Deprecated] N_individuals is no longer supported; please use n_individuals

dissimilarity_coefficient

character. Dissimilarity coefficient used to compare consecutive WUs. See vegan::vegdist() for details.

  • "euc" - Euclidean distance

  • "euc.sd" - standardised Euclidean distance

  • "chord" - Chord distance

  • "chisq" - Chi-squared coefficient

  • "gower" - Gower's distance

  • "bray" - Bray-Curtis dissimilarity

DC

[Deprecated] DC is no longer supported; please use dissimilarity_coefficient

tranform_to_proportions

logical. If TRUE (default), community data are converted to proportions before dissimilarity is computed.

rand

numeric. Number of randomisation runs. Set to NULL (default) for a single run. The single run uses the point ages (age_uncertainty is not used), and it is deterministic unless samples are selected at random (bin_selection = "random" with working_units = "bins" or "MW") or counts are rarefied (standardise = TRUE). With these settings or with age_uncertainty, fewer than 100 runs (including NULL) give a warning unless silent = TRUE. With 100 runs or more, a warning gives the recommended number of runs when the Monte Carlo error is too large (see Details and check_rand()).

use_parallel

Controls parallel computation of randomisation runs.

  • FALSE (default) - single core only.

  • TRUE - all cores available to the R session, as reported by parallelly::availableCores(). This respects the cores allocated to a job by an HPC scheduler (for example SLURM), container limits, and the option mc.cores. If only one core is available, runs on a single core.

  • A positive numeric - use that many cores. 1 is the same as FALSE.

When the runs draw random numbers (random bin selection or standardise = TRUE), each run has its own random-number stream, created before the runs start. Seeded results (see Details of estimate_roc()) are therefore identical for any value of use_parallel and silent.

interest_threshold

numeric. Optional. Samples older than this age are excluded from the output.

time_standardisation

numeric. Time unit for RoC values. RoC is reported as dissimilarity per time_standardisation years. Defaults to bin_size when NULL.

verbose

logical. If TRUE, print progress messages during computation.

See also