powered by
Validate a single longitude/latitude pair to ensure both values are numeric scalars and fall within valid geographic bounds.
validateLonLat(longitude = NULL, latitude = NULL)
Invisibly returns TRUE if validation succeeds.
TRUE
Single longitude in decimal degrees east.
Single latitude in decimal degrees north.
Longitudes must fall between -180 and 180 degrees and latitudes must fall between -90 and 90 degrees. If validation fails, an error is generated.
validateLonLat(-122.5, 47.5) if (FALSE) { validateLonLat(-200, 47.5) validateLonLat(-122.5, NA) }
Run the code above in your browser using DataLab