Collects every threshold used by filter_occurrences() and the list of
tests to run. Two presets give sensible defaults:
Usage
filter_settings(
preset = c("strict", "lenient"),
...,
add_tests = NULL,
drop_tests = NULL
)Arguments
- preset
"strict"(default) or"lenient".- ...
Settings to change; see the Settings section.
- add_tests, drop_tests
Test names (see
filter_tests()) to add to or remove from the preset's list of tests.
Details
"strict"- point quality for the presence records used in modelling: finer coordinate uncertainty, stricter settlement, sea and cropland limits, the stated-country check and the isolation tests."lenient"- for delimiting the accessible area (the M of the BAM diagram) or other uses where losing good records is worse than keeping a few doubtful ones. No country check and no isolation tests.
Any setting can be changed through ..., e.g.
filter_settings("strict", max_coord_unc_m = 500). Tests are switched off
with drop_tests and on with add_tests.
Species-specific thresholds have no default. The climate tests
(climate_limit, climate_soft_limit, refuge_limit,
isolation_climate) depend on the species and are off until you set them;
they are in the units of the climate raster you supply (check whether it is
degrees C, Kelvin or scaled by 10). For the arctic-alpine Dryas
octopetala with CHELSA bio10 (mean temperature of the warmest quarter, deg
C), the strict values used were climate_limit = 22,
climate_soft_limit = 16, refuge_limit = 11, refuge_radius_km = 10 and
isolation_climate = 14.
Settings
target_taxonAccepted name(s) of the taxon being modelled, e.g.
"Dryas octopetala"(several for a group of species). Used byname_synonym_conflict;NAswitches that test off. The name tests need the columns added bymatch_names().target_rankFinest rank a record must reach (default
"species"): records identified only to a coarser rank, e.g. the genus, failrank_conflict.infraspecific_include,infraspecific_excludeWhich infraspecific taxa of the target are in scope: names of subspecies, varieties or forms (as matched or accepted, e.g.
"Dryas octopetala subsp. hookeriana").infraspecific_include = NA(default) accepts all; otherwise only those listed. Listed ininfraspecific_exclude: always removed (rank_conflict, reasoninfraspecific_excluded). In polyploid complexes, where cytotypes are often recorded under an aggregate or a species name, declare here which taxa belong to the unit you model.aggregates_in_scopeKeep records named as an aggregate (agg., s.l.) of the target (default
TRUE); withFALSEthey failrank_conflict(reasonaggregate_name).hybrids_in_scopeKeep hybrid names (default
FALSE: they failname_synonym_conflict, reasonhybrid_name).accept_fuzzy,min_name_confidenceWhether names matched only fuzzily (misspelled) count as matched, and the lowest accepted match confidence (0-100); otherwise they fail
name_unmatched(reasonsfuzzy_nameandlow_name_confidence).dedup_digitsRecords of one species at the same location rounded to this many decimals are duplicates (default 4, about 10 m).
NA= off.grid_cell_sizes_mAtlas grid squares (m). An uncertainty equal to half the diagonal of such a square (e.g. 707.1 m for 1 km) marks the centre of an atlas cell, not a locality.
bad_issues,bad_basis,bad_establishmentGBIF
issueflags,basisOfRecordandestablishmentMeansvalues to remove.max_coord_unc_m,drop_na_uncertaintyLargest accepted coordinate uncertainty (m; strict 1000, lenient 2000), and whether records without a stated uncertainty are removed (default
FALSE).min_coord_decimalsRecords with both coordinates written with fewer decimals are removed (default 3, i.e. 2 or fewer decimals, about 1 km). 0 = off.
garden_regex,settlement_regexRegular expressions searched in locality, habitat and remarks (many languages).
min_yearRecords older than this year are removed (
NA= off).grid_min_unc_m,grid_block_nGrid block rule: at least
grid_block_nrecords of one dataset share the same uncertainty of at leastgrid_min_unc_mm.lattice_min_coords,lattice_ratioLattice rule: a dataset with at least
lattice_min_coordslocations whose distinct latitudes and longitudes are each at mostlattice_ratioof the locations lies on a regular mesh.stack_min_records,stack_ratio,stack_coarse_share,stack_max_specimen_shareStacked rule: a dataset of at least
stack_min_recordsrecords with at leaststack_ratiorecords per location, mostly coarse or unknown uncertainty and mostly not herbarium specimens re-uses a list of grid cells or sites.country_buffer_m,country_check_skipTolerance (m) of the stated-country check and ISO2 codes never checked (default
"SJ", Svalbard, which has no polygon of its own).cc_tests,centroids_radTests passed to
CoordinateCleaner::clean_coordinates()and its centroid radius (m). The"urban"test downloads Natural Earth urban areas (internet needed) unless you supply them infilter_layers().range_buffer_km,range_crs,protect_in_rangeBuffer around the range polygon (km), the projection used for buffering (
"auto"chooses a polar projection for circumpolar data, otherwise one centred on the data), and whether records inside the polygon are exempt from the isolation tests.sea_unc_factor,sea_tol_mA record is at sea when it is farther from land than
max(sea_unc_factor * uncertainty, sea_tol_m).sea_land_pct,sea_ring_unc_mFallback test with a water raster: on water when no cell within a window (own cell; 3x3 cells above
sea_ring_unc_m[1]; 5x5 abovesea_ring_unc_m[2]) has at leastsea_land_pct% land.max_built_pct,max_crop_pctLargest accepted built-up and cropland percentage of the ~1 km cell.
ghs_mean_pct,ghs_max_m2Largest accepted mean built-up % (settlement density) and built-up m2 of the most built 100 m cell within ~1 km (a building nearby), from GHS-BUILT-S.
climate_direction"above"(default: too warm, too dry, ... is bad) or"below"(too cold is bad).climate_limitHard limit: records beyond it are removed.
climate_soft_limit,refuge_radius_km,refuge_limitRecords beyond the soft limit survive only if a cell within
refuge_radius_kmis withinrefuge_limit(e.g. a valley floor below cold mountains).drop_na_climateRemove records without a climate value.
isolation_climate,support_radius_km,min_supportRecords beyond
isolation_climatewith fewer thanmin_supportother records withinsupport_radius_kmare removed.cluster_eps_km,min_cluster_nRecords chained closer than
cluster_eps_kmform a cluster; clusters smaller thanmin_cluster_nare removed.
Examples
s <- filter_settings("strict", max_coord_unc_m = 500,
drop_tests = "too_old")
s$max_coord_unc_m
#> [1] 500
s$tests
#> [1] "name_unmatched" "name_synonym_conflict"
#> [3] "rank_conflict" "duplicate"
#> [5] "grid_cell_centre" "gbif_issue"
#> [7] "basis_of_record" "establishment_means"
#> [9] "coord_uncertainty" "coarse_decimals"
#> [11] "garden_text" "settlement_text"
#> [13] "locality_is_country" "manual_exclude"
#> [15] "excluded_dataset" "grid_uncertainty_block"
#> [17] "lattice_dataset" "stacked_dataset"
#> [19] "country_mismatch" "coordinatecleaner"
#> [21] "outside_range" "at_sea"
#> [23] "no_climate_data" "built_up"
#> [25] "cropland" "ghs_dense"
#> [27] "ghs_building_nearby" "isolated_climate_outlier"
#> [29] "small_isolated_cluster" "climate_limit"
#> [31] "climate_soft_limit"
