Test: fossil outliers in space and time
Source:R/clean.R, R/test-docs.R
test_spatiotemporal_outlier.RdFlags fossil records that are far from the other records of their taxon in space and time together. Ages are drawn as in test_age_outlier; for each pair of records the age difference is rescaled so that the largest age difference equals the largest geographic distance, added to the haversine distance in km between coordinates rounded to 0.1 degrees (Euclidean degrees for taxa of 10,000 records or more) and rounded; each record's mean over all records of its taxon is compared with the upper fence. Replicates, majority and seeding are as in test_age_outlier.
Usage
clean_spatiotemporal_outlier(
x,
method = "quantile",
mltpl = 5,
size_thresh = 7,
replicates = 5,
flag_thresh = 0.5,
uniq_loc = FALSE,
seed = 1L,
...
)Arguments
- x
A data frame of occurrence records.
- method, mltpl, size_thresh, replicates, flag_thresh, uniq_loc, seed
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.
Settings
settings = list(spatiotemporal_outlier = list(...))
with the same options and defaults as age_outlier.
CoordinateCleaner
Equivalent to cf_outl() at taxon level, the
spatiotemp test of clean_fossils(); identical flags when every range
has zero width, and otherwise a single run can differ record by record,
as for age_outlier.
See also
flag_occurrences(), flag_tests()
Other tests:
clean_age_equal(),
clean_age_outlier(),
clean_age_range_outlier(),
clean_aohi(),
clean_basis_fossil(),
clean_capital(),
clean_centroid(),
clean_country_mismatch(),
clean_dataset_ddmm(),
clean_dataset_rounded(),
clean_duplicate(),
clean_equal(),
clean_establishment_introduced(),
clean_gbif_headquarters(),
clean_institution(),
clean_invalid(),
clean_issue_coordinate(),
clean_outlier(),
clean_range(),
clean_sea(),
clean_sea_nonmarine(),
clean_urban(),
clean_zero()
Examples
set.seed(1)
x <- data.frame(accepted_name = "A", lng = c(runif(20, 0, 5), 120), lat = c(runif(20, 40, 45), -30),
min_ma = 20, max_ma = 20)
cols <- occ_columns(lon = "lng", lat = "lat", species = "accepted_name")
flag_occurrences(x, tests = "spatiotemporal_outlier", columns = cols)$flag_spatiotemporal_outlier
clean_spatiotemporal_outlier(x, columns = cols)