Learn R Programming

⚠️There's a newer version (3.0.1) of this package.Take me there.

CoordinateCleaner v2.0-20

Automated flagging of common spatial and temporal errors in biological and palaeontological collection data, for the use in conservation, ecology and palaeontology. Specifically includes tests for

  • General coordinate validity
  • Country and province centroids
  • Capital coordinates
  • Coordinates of biodiversity institutions
  • Spatial outliers
  • Temporal outliers
  • Coordinate-country discordance
  • Duplicated coordinates per species
  • Assignment to the location of the GBIF headquarters
  • Urban areas
  • Seas
  • Plain zeros
  • Equal longitude and latitude
  • Rounded coordinates
  • DDMM to DD.DD coordinate conversion errors
  • Large temporal uncertainty (fossils)
  • Equal minimum and maximum ages (fossils)
  • Spatio-temporal outliers (fossils)

CoordinateCleaner can be particularly useful to improve data quality when using data from GBIF (e.g. obtained with rgbif) or the Paleobiology database (e.g. obtained with paleobioDB) for historical biogeography (e.g. with BioGeoBEARS or phytools), automated conservation assessment (e.g. with speciesgeocodeR or conR) or species distribution modelling (e.g. with dismo or sdm). See scrubr and taxize for complementary taxonomic cleaning or biogeo for correcting spatial coordinate errors.

See News for update information.

Installation

Stable from CRAN

install.packages("CoordinateCleaner")
library(CoordinateCleaner)

Developmental from GitHub

devtools::install_github("ropensci/CoordinateCleaner")
library(CoordinateCleaner)

Usage

A simple example:

# Simulate example data
minages <- runif(250, 0, 65)
exmpl <- data.frame(species = sample(letters, size = 250, replace = TRUE),
                    decimallongitude = runif(250, min = 42, max = 51),
                    decimallatitude = runif(250, min = -26, max = -11),
                    min_ma = minages,
                    max_ma = minages + runif(250, 0.1, 65),
                    dataset = "clean")

# Run record-level tests
rl <- clean_coordinates(x = exmpl)
summary(rl)
plot(rl)

# Dataset level 
dsl <- clean_dataset(exmpl)

# For fossils
fl <- clean_fossils(x = exmpl,
                          taxon = "species",
                          lon = "decimallongitude", 
                          lat = "decimallatitude")
summary(fl)

# Alternative example using the pipe
library(tidyverse)

cl <- exmpl %>%
  cc_val()%>%
  cc_cap()%>%
  cd_ddmm()%>%
  cf_range(lon = "decimallongitude", 
           lat = "decimallatitude", 
           taxon  ="species")

Documentation

Pipelines for cleaning data from the Global Biodiversity Information Facility (GBIF) and the Paleobiology Database (PaleobioDB) are available in here.

Contributing

See the CONTRIBUTING document.

Citation

Zizka A, Silvestro D, Andermann T, Azevedo J, Duarte Ritter C, Edler D, Farooq H, Herdean A, Ariza M, Scharn R, Svanteson S, Wengtrom N, Zizka V & Antonelli A (2019) CoordinateCleaner: standardized cleaning of occurrence records from biological collection databases. Methods in Ecology and Evolution, 10(5):744-751, doi:10.1111/2041-210X.13152, https://github.com/ropensci/CoordinateCleaner

Copy Link

Version

Install

install.packages('CoordinateCleaner')

Monthly Downloads

1,371

Version

2.0-20

License

GPL-3

Maintainer

Last Published

October 21st, 2021

Functions in CoordinateCleaner (2.0-20)

buffsea

Global Coastlines buffered by -1 degree
CoordinateCleaner-package

CoordinateCleaner
buffland

Global Coastlines buffered by 1 degree
cc_cap

Identify Coordinates in Vicinity of Country Capitals.
cc_coun

Identify Coordinates Outside their Reported Country
cc_equ

Identify Records with Identical lat/lon
cc_cen

Identify Coordinates in Vicinity of Country and Province Centroids
cc_dupl

Identify Duplicated Records
cc_gbif

Identify Records Assigned to GBIF Headquarters
cc_inst

Identify Records in the Vicinity of Biodiversity Institutions
cf_age

Identify Fossils with Outlier Age
pbdb_example

Example data from the Paleobiologydatabase
institutions

Global Locations of Biodiversity Institutions
cf_equal

Identify Fossils with equal min and max age
cd_round

Identify Datasets with Rasterized Coordinates
clean_coordinates

Geographic Cleaning of Coordinates from Biologic Collections
cd_ddmm

Identify Datasets with a Degree Conversion Error
cc_sea

Identify Non-terrestrial Coordinates
cc_urb

Identify Records Inside Urban Areas
clean_dataset

Coordinate Cleaning using Dataset Properties
cc_val

Identify Invalid lat/lon Coordinates
cf_outl

Identify Outlier Records in Space and Time
cf_range

Identify Fossils with Extreme Age Ranges
plot.spatialvalid

Plot Method for Class Spatialvalid
write_pyrate

Create Input Files for PyRate
cc_zero

Identify Zero Coordinates
countryref

Country Centroids and Country Capitals
cc_iucn

Identify Records Outside Natural Ranges
clean_fossils

Geographic and Temporal Cleaning of Records from Fossil Collections
cc_outl

Identify Geographic Outliers in Species Distributions