checkLL | R Documentation |
check lat-long coordinates for plausibility
checkLL(lat, long, data, fun = stop, quiet = FALSE, ...)
lat, long |
Latitude (North/South) and longitude (East/West) coordinates in decimal degrees |
data |
Optional: data.frame with the columns |
fun |
One of the functions |
quiet |
Logical: suppress non-df warning in |
... |
Further arguments passed to |
Invisible T/F vector showing which of the coordinates is violated in the order: minlat, maxlat, minlong, maxlong. Only returned if check is passed or fun != stop
Berry Boessenkool, berry-b@gmx.de, Aug 2016
pointsMap
, putm
,
berryFunctions::checkFile
checkLL(lat=52, long=130)
checkLL(130, 52, fun=message)
checkLL(85:95, 0, fun=message)
d <- data.frame(x=0, y=0)
checkLL(y,x, d)
# informative errors:
library("berryFunctions")
is.error( checkLL(85:95, 0, fun="message"), tell=TRUE)
is.error( checkLL(170,35), tell=TRUE)
mustfail <- function(expr) stopifnot(berryFunctions::is.error(expr))
mustfail( checkLL(100) )
mustfail( checkLL(100, 200) )
mustfail( checkLL(-100, 200) )
mustfail( checkLL(90.000001, 0) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.