CoordinateCleaner includes a set of functions suited for fossil records including tests for imprecise or erroneous dating. clean_fossils is a wrapper including relevant spatial and temporal tests. As all test the temporal tests can be called individually, using the cf_equal, cf_range and cf_outl functions.

Please find a detailed tutorial on how to clean occurrence records (e.g. from GBIF) here and how to clean fossil data (e.g. from PBDB) here.

library(CoordinateCleaner)
## Registered S3 method overwritten by 'dplyr':
##   method               from  
##   as.data.frame.tbl_df tibble
## Registered S3 methods overwritten by 'ggplot2':
##   method         from 
##   [.quosures     rlang
##   c.quosures     rlang
##   print.quosures rlang

# Simulate example data
minages <- runif(250, 0, 65)
exmpl <- data.frame(accepted_name = sample(letters, size = 250, replace = TRUE),
                    lng = runif(250, min = 42, max = 51),
                    lat = runif(250, min = -26, max = -11),
                    min_ma = minages,
                    max_ma = minages + runif(250, 0.1, 65))

# Run fossil test
test <- clean_fossils(x = exmpl)
## Testing coordinate validity
## Flagged 0 records.
## Testing equal lat/lon
## Flagged 0 records.
## Testing zero coordinates
## Flagged 0 records.
## Testing country centroids
## Flagged 0 records.
## Testing spatio-temporal outliers on taxon level
## Warning in cf_outl(x = x, lon = lon, lat = lat, min_age = min_age, max_age
## = max_age, : decimallatitude not found. Using lat instead.
## Warning in cf_outl(x = x, lon = lon, lat = lat, min_age = min_age, max_age
## = max_age, : decimallongitude not found. Using lng instead.
## Flagged 0 records.
## Warning in cf_range(x = test, taxon = "", min_age = min_age, max_age =
## max_age, : decimallatitude not found. Using lat instead.
## Warning in cf_range(x = test, taxon = "", min_age = min_age, max_age =
## max_age, : decimallongitude not found. Using lng instead.
## Testing temporal range outliers on dataset level
## Flagged 0 records.
## Warning in cf_range(ran.test, taxon = taxon, min_age = min_age, max_age =
## max_age, : decimallatitude not found. Using lat instead.
## Warning in cf_range(ran.test, taxon = taxon, min_age = min_age, max_age =
## max_age, : decimallongitude not found. Using lng instead.
## Testing temporal range outliers on taxon level
## Flagged 0 records.
## Testing age validity
## Flagged 0 records.
## Testing GBIF headquarters, flagging records around Copenhagen
## Flagged 0 records.
## Testing biodiversity institutions
## Flagged 0 records.
## Flagged 0 of 250 records, EQ = 0

summary(test)
## decimallatitude             aeq             cen             gbf 
##               0               0               0               0 
##            inst             spt             zer         summary 
##               0               0               0               0