Skip to contents

Flags records whose longitude or latitude is missing, not a number, or outside [-180, 180] x [-90, 90]. Text columns are coerced with as.numeric(as.character()) first. A record failing this test gets no other spatial flag.

Usage

clean_invalid(x, ...)

Arguments

x

A data frame of occurrence records.

...

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

lon, lat (see occ_columns()).

CoordinateCleaner

Equivalent to cc_val(). Its other spatial tests return NA or "clean" for invalid rows; here those rows carry only the invalid bit.

Examples

x <- data.frame(decimalLongitude = c("16.37", "abc", NA, "200"),
                decimalLatitude = c("48.21", "10", "10", "10"))
flag_occurrences(x, tests = "invalid")$flag_invalid
clean_invalid(x)