Removes or flags records with either zero longitude or latitude and a radius around the point at zero longitude and zero latitude. These problems are often due to erroneous data-entry or geo-referencing and can lead to typical patterns of high diversity around the equator.
cc_zero(
x,
lon = "decimalLongitude",
lat = "decimalLatitude",
buffer = 0.5,
value = "clean",
verbose = TRUE
)
data.frame. Containing geographical coordinates and species names.
character string. The column with the longitude coordinates. Default = “decimalLongitude”.
character string. The column with the latitude coordinates. Default = “decimalLatitude”.
numerical. The buffer around the 0/0 point, where records should be flagged as problematic, in decimal degrees. Default = 0.5.
character string. Defining the output value. See value.
logical. If TRUE reports the name of the test and the number of records flagged.
Depending on the ‘value’ argument, either a data.frame
containing the records considered correct by the test (“clean”) or a logical vector (“flagged”), with TRUE = test passed and FALSE = test failed/potentially problematic . Default = “clean”.
See https://ropensci.github.io/CoordinateCleaner/ for more details and tutorials.
x <- data.frame(species = "A",
decimalLongitude = c(0,34.84, 0, 33.98),
decimalLatitude = c(23.08, 0, 0, 15.98))
cc_zero(x)
#> Testing zero coordinates
#> Removed 3 records.
#> species decimalLongitude decimalLatitude
#> 4 A 33.98 15.98
cc_zero(x, value = "flagged")
#> Testing zero coordinates
#> Flagged 3 records.
#> [1] FALSE FALSE FALSE TRUE