These functions return metadata associate with a point location.

get_state(location, group)

get_province(location, group)

get_country(location, group)

get_coords(location, group, keep_cols = FALSE)

Arguments

location

character, a name of a location in the locs data frame. May be a vector.

group

character, the region group/set the location belongs to. If supplied, the locs data set is first filtered to group. May be a vector.

keep_cols

logical, keep all columns with get_coords. Defaults to FALSE, returning only the lon and lat columns.

Value

a character string, or a data frame for get_coords.

Details

get_state returns the state, province or territory of a point location. get_country returns the name of the country (US or Canada). get_coords returns the longitutde and latitude of a point location as a data frame.

Examples

x <- "Calgary" get_state(x)
#> [1] "Alberta"
get_country(x)
#> [1] "Canada"
get_coords(x)
#> # A tibble: 1 x 2 #> lon lat #> <dbl> <dbl> #> 1 -114. 51.0