Automated flagging of common spatial and temporal errors in biological and palaeontological collection data, for the use in conservation, ecology and palaeontology.
The version 0.1.0 of rnaturalearthdata does not have a "iso_a3_eh" field in the ne_countries object. This causes cc_coun to crash whenever is used, by returning the following error
Error in [.data.frame(sp::over(x = dat, y = ref), , "iso_a3_eh") :
undefined columns selected
traceback()
5: stop("undefined columns selected")
4: [.data.frame(sp::over(x = dat, y = ref), , "iso_a3_eh")
3: sp::over(x = dat, y = ref)[, "iso_a3_eh"]
2: cc_coun(x, lon = lon, lat = lat, iso3 = countries, ref = country_ref,
verbose = verbose, value = "flagged")
1: CoordinateCleaner::clean_coordinates(occ.table.clean, lon = "decimalLongitude",
lat = "decimalLatitude", species = "species", countries = "countryCode",
value = "clean", tests = c("countries", "capitals", "centroids",
"equal", "gbif", "institutions", "outliers", "seas",
"zeros"))
Reproducible example
CoordinateCleaner version 2.0-11
rnaturalearth version 0.1.0
rnaturalearthdata version 0.1.0
#occ.table is a data frame downloaded from gbif in simple_csv format
library(ISOcodes)
occ.table$countryCode <- ISO_3166_1$Alpha_3[match(occ.table$countryCode, ISOcodes::ISO_3166_1$Alpha_2)] #Change ISO2 for ISO3 as required by CoordinateCleaner
occ.table.clean <- CoordinateCleaner::clean_coordinates(occ.table.clean,
lon="decimalLongitude",
lat="decimalLatitude",
species="species",
countries = "countryCode",
value="clean",
tests=c("countries","capitals","centroids", "equal", "gbif",
"institutions", "outliers", "seas","zeros"))
The version 0.1.0 of rnaturalearthdata does not have a "iso_a3_eh" field in the ne_countries object. This causes cc_coun to crash whenever is used, by returning the following error
traceback()
Reproducible example CoordinateCleaner version 2.0-11 rnaturalearth version 0.1.0 rnaturalearthdata version 0.1.0