Removes or flags records within a radius around the geographic centroids of political countries and provinces. Poorly geo-referenced occurrence records in biological databases are often erroneously geo-referenced to centroids.

  lon = "decimallongitude",
  lat = "decimallatitude",
  species = "species",
  buffer = 1000,
  geod = TRUE,
  test = "both",
  ref = NULL,
  verify = FALSE,
  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”.


character string. The column with the species identity. Only required if verify = TRUE.


numerical. The buffer around each province or country centroid, where records should be flagged as problematic. Units depend on geod. Default = 1 kilometre.


logical. If TRUE the radius around each capital is calculated based on a sphere, buffer is in meters and independent of latitude. If FALSE the radius is calculated assuming planar coordinates and varies slightly with latitude, in this case buffer is in degrees. Default = TRUE. See for detail and credits.


a character string. Specifying the details of the test. One of c(“both”, “country”, “provinces”). If both tests for country and province centroids.


SpatialPointsDataFrame. Providing the geographic gazetteer. Can be any SpatialPointsDataFrame, but the structure must be identical to countryref. Default = countryref.


logical. If TRUE records are only flagged if they are the only record in a given species flagged close to a given reference. If FALSE, the distance is the only criterion


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 for more details and tutorials.

See also

Other Coordinates: cc_cap(), cc_coun(), cc_dupl(), cc_equ(), cc_gbif(), cc_inst(), cc_iucn(), cc_outl(), cc_sea(), cc_urb(), cc_val(), cc_zero()


x <- data.frame(species = letters[1:10], decimallongitude = runif(100, -180, 180), decimallatitude = runif(100, -90,90)) cc_cen(x, geod = FALSE)
#> Testing country centroids
#> Warning: Spatial object is not projected; GEOS expects planar coordinates
#> Removed 100 records.
#> [1] species decimallongitude decimallatitude #> <0 rows> (or 0-length row.names)
if (FALSE) { #' cc_inst(x, value = "flagged", buffer = 50000) #geod = T }