Description Usage Arguments Details Value Examples
View source: R/parse_hemisphere.R
BEWARE: EXPERIMENTAL
1 | parse_hemisphere(lon, lat)
|
lon |
(character/numeric/integer) one or more longitude values |
lat |
(character/numeric/integer) one or more latitude values |
length(lon) == length(lat)
character vector of quadrants, one of: NE, NW, SE, SW. if one of the coordinate values is invalid, and one is valid, you get a length 1 string. if both coordinate values are bad, you get a zero length string.
Warnings are thrown on invalid values
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # NE
parse_hemisphere("74.123E", "45N54.2356")
## Not run:
# NW
parse_hemisphere(-120, 40.4183318)
# SW
parse_hemisphere(-120, -40.4183318)
# SE
parse_hemisphere(120, -40.4183318)
# bad inputs, get one of the two strings
parse_hemisphere(-181, -40.4183318)
parse_hemisphere(-120, -192.4183318)
# many inputs
library(randgeo)
pts <- rg_position(count = 1000)
lons <- as.character(vapply(pts, "[[", 1, 1))
lats <- as.character(vapply(pts, "[[", 1, 2))
parse_hemisphere(lons, lats)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.