Without tests, flag_occurrences() runs every test whose inputs are
available: the columns the test reads (the needs column of
flag_tests(), named through occ_columns()) and, for range, species
range polygons in gazetteers. Running a test only adds its flags, so
which records to exclude is decided afterwards by a cleaning rule (see
has_flag() and tally_flags()).
Usage
test_plan(x, columns = occ_columns(), gazetteers = NULL)Arguments
- x
Input to
flag_occurrences(): a data frame, or a path to a file or directory. Or its output: anocc_flagsdata frame, anocc_flaggedobject, or the output directory.- columns, gazetteers
As in
flag_occurrences(); used for input only.
Value
A data frame with one row per test in layout order: test, run
(logical), missing (the input the test lacks: column names, "range polygons", or "a path" for a grouped test given a single-run
vectra_node; NA when it runs or was not requested) and reason (why
the test does not run, NA when it runs).
Details
For input, test_plan() lists the tests that would run and the reason each
other test would not. For flag output, it lists the tests that ran and the
reason each other test did not: a missing input, or "not requested" when
tests named the tests to run.
Examples
x <- data.frame(species = c("a", "a", "b"),
decimalLongitude = c(12.58, 0, 16.37),
decimalLatitude = c(55.67, 0, 48.21))
p <- test_plan(x)
p[p$run, "test"]
p[!p$run, ]