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

Problems with clean_coordinates() #38

Closed pablosanchezmart closed 4 years ago

pablosanchezmart commented 4 years ago

Hello,

I have some problems when I run clean_coordinates(). More concretely, when I set "outliers" and "urban". With "outliers" I have the following error:

Error in ras_dist(x = k, lat = lat, lon = lon, ras = ras, weights = TRUE)

And with "urban" the following one:

error in .rownamesdf<-(x, value = value) : invalid 'row.names' length

I am working with the last R version and the las version of the package and my coordinates database seems to be ok, so there may be something wrong with the code?

I would appreaciate some help here, as I really want to use this extremely useful package.

Thanks a lot,

Pablo

azizka commented 4 years ago

OK. Could you provide some example data to reproduce the error? Thanks!

pablosanchezmart commented 4 years ago

Hi, finally I've manage to do it. Instead of including the outliers cleaning into the clean_coorinates() function I am doing it separately, as it follows:

Clean coordinates

clean <- clean_coordinates(x = occ.df, lon = "longitude", lat = "latitude", species = "species", tests = c("capitals", "duplicates","equal","gbif", "institutions", "seas", "zeros"), value = c("clean"), verbose = F)

clean.outl<- cc_outl(clean, lon = "longitude", lat = "latitude", species = "species", method = "quantile", value = "clean")

Thanks!

Pablo