Closed ThaiseEmilio closed 6 years ago
Hej, thanks for the issue, that indeed seems unnecessary. Objects of class spatialvalid should have standardized column names. I couldn't reproduce the problem though. Which version of CoordinateCleaner are you using, and could you provide (a few lines) of example data?
Hiya, Thanks for the reply. I just installed the GitHub version.
packageVersion("CoordinateCleaner") [1] ‘1.1.1’
Please see below the the full code.
Thanks, Thaise
rm(list=ls()) install.packages("devtools") library(devtools) install_github("azizka/CoordinateCleaner")
library(tidyverse) library(rgbif) library(countrycode) library(CoordinateCleaner)
packageVersion("CoordinateCleaner")
gbif <- occ_search(scientificName = "Phoenix dactylifera", limit = 20000, return = "data", hasCoordinate = T)
gbif <- gbif %>% dplyr::select(species, decimalLongitude, decimalLatitude, countryCode, individualCount, gbifID, family, taxonRank, coordinateUncertaintyInMeters, year, basisOfRecord, institutionCode, datasetName)
gbif$countryCode3 <- countrycode(gbif$countryCode, origin = 'iso2c', destination = 'iso3c')
dat <- data.frame(gbif) flags <- CleanCoordinates(x = gbif, lon = "decimalLongitude", lat = "decimalLatitude", countries = "countryCode3", species = "species", countrycheck = T, outliers = T) # most test are on by default
plot(flags) # return error
colnames(flags)[2:3]<-c("decimallongitude", "decimallatitude") plot(flags) # now ok
fixed in version 2.0-2
Hiya, I am following the tutorial using my own data and found a minor problem with plot.spatialvalid as the attribute the lon and lat columns are not recognized automatically.
My quick-and-dirty solution was renaming the columns in the CleanCoordinates output before plotting.
This works fine but will be easier if it was not necessary and this implementation will be welcome. Thanks, Thaise