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

Can only run CleanCoordinates outlier check on a tibble, not a data frame #2

Closed HMB3 closed 5 years ago

HMB3 commented 6 years ago

Hi everyone,

Not sure if this is just my problem. But I could only get the outliers test to work if I converted my data frame to a tiblble. Has anyone else encountered that? EG runnning this code on a df doesn't work ::

FLAGS <- CleanCoordinates(df, countrycheck = TRUE, duplicates = TRUE, outliers = TRUE, outliers.method = "quantile", outliers.mtp = 5, outliers.td = 1000, seas = FALSE)

Error in data.frame(inp, validity = val, equal = equ, zeros = zer, capitals = cap, : arguments imply differing number of rows: 2023, 1292922

But when using a tibble, the outliers check runs fine. Not sure what is happening there - only the outliers detection is a problem, the other checks are ok when run on the df.

Thanks again and hope this helps,

Hugh

azizka commented 6 years ago

Hej, I can't reproduce the issue. Could you please provide a minimal working example? Thanks,

Alex

HMB3 commented 6 years ago

Hi Alex,

I just ran the CleanCoordinates function on a dataframe, and it now works.

It's tricky to upload an example file, so just let me know if that's ok,

h

HMB3 commented 6 years ago

This will work ::

FLAGS <- CleanCoordinates(DF capitals.rad = 0.12, countrycheck = TRUE, duplicates = TRUE, seas = FALSE)