ropensci / CoordinateCleaner

Automated flagging of common spatial and temporal errors in biological and palaeontological collection data, for the use in conservation, ecology and palaeontology.
https://docs.ropensci.org/CoordinateCleaner/
79 stars 21 forks source link

Error in outlier test in clean_coordinates() #48

Closed damariszurell closed 4 years ago

damariszurell commented 4 years ago

Hi there, It seems this issue has been reported before, but still causes troubles.

Specifically, the outlier test in clean_coordinates() throws an error while cc_outl() works alright.


SessionInfo: R version 4.0.2 (2020-06-22) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Catalina 10.15.5

other attached packages: CoordinateCleaner_2.0-15 rgbif_3.2.0


Example code

library(rgbif)
gbif_shrew <- occ_search(scientificName = "Sorex alpinus")$data

library(CoordinateCleaner)
gbif_shrew <- subset(gbif_shrew, !is.na(decimalLatitude))
clean_coordinates(gbif_shrew, lon="decimalLongitude", lat="decimalLatitude", tests="outliers")

produces the following error:

image
# This works alright:
cc_outl(gbif_shrew, lon="decimalLongitude", lat="decimalLatitude")
azizka commented 4 years ago

Hi! Hm this works for me under CoordinateCleaner v2.0-16. Since you use v2.0-15, could you try to install the latest version, and report if the problem persists?

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

Thanks!

damariszurell commented 4 years ago

Thanks, it works fine with CoordinateCleaner v2.0-16 !

azizka commented 4 years ago

Great!