Skip to contents

Plot RoC scores through time with an upper uncertainty envelope and, optionally, a superimposed trend curve and peak-point markers.

Usage

plot_roc(
  data_source,
  age_threshold = NULL,
  roc_threshold = NULL,
  peaks = FALSE,
  trend = NULL,
  silent = FALSE
)

Arguments

data_source

tibble. Output of estimate_roc() or detect_peak_points().

age_threshold

numeric. Optional. Upper (oldest) age cut-off; samples older than this value are excluded from the plot.

roc_threshold

numeric. Optional. Upper RoC cut-off; values above this are clipped.

peaks

logical. If TRUE and a Peak column is present in data_source, peak points are highlighted on the plot (default = FALSE).

trend

character or NULL. When peaks = TRUE, optionally overlay the trend curve used during peak detection. One of "threshold", "trend_linear", or "trend_non_linear". NULL (default) shows no trend line.

silent

logical. If TRUE, suppress all console output (default = FALSE).

Value

A ggplot2 object.

Examples

if (FALSE) { # \dontrun{
data("example_data", package = "RRatepol")

sequence_01 <-
  estimate_roc(
    data_source_community = example_data$pollen_data[[1]],
    data_source_age = example_data$sample_age[[1]],
    smooth_method = "shep",
    working_units = "MW",
    rand = 1e3,
    use_parallel = TRUE,
    dissimilarity_coefficient = "chisq"
  )

plot_roc(
  sequence_01,
  age_threshold = 8e3,
  roc_threshold = 1
)
} # }