Closed AMBarbosa closed 2 years ago
You can now keep the or9ginal names with argument fixnames=FALSE
f <- sp_occurrence("solanum", "cantense")
g <- sp_occurrence("solanum", "cantense", fix=FALSE)
names(f)[!(names(f) %in% names(g))]
#[1] "adm1" "adm2" "cloc" "fullCountry" "ISO2" "lat" "lon"
names(g)[!(names(g) %in% names(f))]
#[1] "countryCode" "county" "decimalLatitude" "decimalLongitude" "stateProvince"
I often like to have students use
geodata::sp_occurrence
instead of the more widely usedrgbif
functions, because it's simpler to install and the resulting object is simpler to handle. However, this breaks downstream code that uses the original GBIF column names "decimalLongitude" and "decimalLatitude", and makes it difficult to have everyone use whichever function they prefer and then use the remaining scripts seamlessly. Is there a good reason forgeodata::sp_occurrence
to change these names to 'lon' and 'lat'? Could an option be provided for keeping the original column names? Cheers