Skip to contents

Two tests set the land test against the habitat of the record's genus:

  • sea_nonmarine flags records outside the land polygons whose genus does not live in the sea (a tree or a toad in open water);

  • land_marine flags records inside the land polygons whose genus lives only in the sea (a starfish or a coral inland).

Usage

clean_sea_nonmarine(x, buffer = 0, ...)

clean_land_marine(x, buffer = 0, ...)

Arguments

x

A data frame of occurrence records.

buffer

Buffer distance of the test, in the unit of its Buffer section; the default is the test's default buffer.

...

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.

Details

The genus habitats come from the Interim Register of Marine and Nonmarine Genera (IRMNG; Rees, T. (compiler) (2026). The Interim Register of Marine and Nonmarine Genera. Available from https://www.irmng.org at VLIZ; CC BY 4.0), see reference_habitat() for how a genus is classed. Records of a genus IRMNG does not class (missing flags, or both habitats, as for gulls, seals, salmon or mangroves) are not tested. The genus is the first word of the genus field, so a binomial species column works too; a kingdom column, when present, resolves genus names used in two kingdoms. The land is the layer of sea: land_scale, or gazetteers$sea.

A coarse coast puts coastal records on the wrong side: at the default land_scale = 110 the coastline is generalised by kilometres. The buffers leave records within that distance of the coast untested.

Marine fossils of a living marine genus lie on land too; combine with basis_fossil in a rule to keep them.

Fields

lon, lat, genus; kingdom when present.

Buffer

buffers = list(sea_nonmarine = 0, land_marine = 0), in metres from the land polygon edge.

Custom gazetteer

gazetteers = list(habitat = <data frame>) with columns genus, marine (logical: TRUE only marine, FALSE not marine) and optionally kingdom; gazetteers = list(sea = <sf>) replaces the land.

CoordinateCleaner

Not in CoordinateCleaner, whose cc_sea() flags every record off the land, marine or not.

Examples

x <- data.frame(kingdom = c("Plantae", "Animalia", "Animalia", "Plantae"),
                genus = c("Quercus", "Asterias", "Asterias", "Quercus"),
                decimalLongitude = c(-30, 16.37, -30, 16.37),
                decimalLatitude = c(40, 48.21, 40, 48.21))
f <- flag_occurrences(x, tests = c("sea", "sea_nonmarine", "land_marine"))
f[, c("genus", "flag_sea", "flag_sea_nonmarine", "flag_land_marine")]
clean_sea_nonmarine(x)