The clean_coordinates function stops with an error if there are rows with missing (NA) coordinates:
> gbif <- rgbif::occ_data(scientificName = "Pan troglodytes")
> clean_coordinates(gbif$data, lon = "decimalLongitude", lat = "decimalLatitude")
Testing coordinate validity
Flagged 4 records.
Error in clean_coordinates(gbif$data, lon = "decimalLongitude", lat = "decimalLatitude") :
invalid coordinates found in rows, clean dataset before proceeding:
53
64
345
467
It's a bit baffling to users that a function called clean_coordinates tells them to "clean dataset before proceeding". Couldn't the function just flag these records too, and/or output NA in their test results? The same for other types of invalid coordinates.
Otherwise, it would at least be helpful if the error message were clearer, e.g. "missing coordinates are not allowed".
Cheers
The
clean_coordinatesfunction stops with an error if there are rows with missing (NA) coordinates:It's a bit baffling to users that a function called
clean_coordinatestells them to "clean dataset before proceeding". Couldn't the function just flag these records too, and/or output NA in their test results? The same for other types of invalid coordinates.Otherwise, it would at least be helpful if the error message were clearer, e.g. "missing coordinates are not allowed".
Cheers