Skip to contents

Flags fossil records whose age range (max_age - min_age) lies above the upper fence of the ranges of the other records of their taxon (Q75 + mltpl x IQR, or median + mltpl x MAD). A record dated only to a long period among records dated to stages is the typical case. With level = "all" the fence is taken over the whole input instead of per taxon, as in CoordinateCleaner's dataset-level cf_range(taxon = ""). A fixed limit in million years needs no test: the range stays a raw column and is cut in tally_flags().

Usage

clean_age_range_outlier(
  x,
  method = "quantile",
  mltpl = 5,
  size_thresh = 7,
  uniq_loc = FALSE,
  level = "taxon",
  ...
)

Arguments

x

A data frame of occurrence records.

method, mltpl, size_thresh, uniq_loc, level

Options of the test, as in Settings; the defaults are in the usage line.

...

Further arguments to flag_occurrences(): columns, reference, gazetteers, land_scale.

Value

clean_<test>(): the rows of x the test does not flag, with the columns of x unchanged. See keep_unflagged(), Cleaning functions.

Fields

min_age, max_age, species.

Settings

settings = list(age_range_outlier = list(...)) with method ("quantile"), mltpl (5), size_thresh (7), uniq_loc (FALSE) and level ("taxon").

CoordinateCleaner

Equivalent to cf_range() with method = "quantile" or "mad"; identical flags. With uniq_loc = TRUE, CoordinateCleaner also flags records of other taxa that happen to share a flagged range width; here the flag goes to the records with the same taxon, coordinates and ages.

Examples

x <- data.frame(accepted_name = "A", min_ma = 20, max_ma = c(rep(21, 20), 60))
flag_occurrences(x, tests = "age_range_outlier",
                 columns = occ_columns(species = "accepted_name"))$flag_age_range_outlier
clean_age_range_outlier(x, columns = occ_columns(species = "accepted_name"))