w3w: What 3 Words wrapper

Description Usage Arguments Value Examples

View source: R/coordinates.R

Description

This function requires you to have a valid what3words API key called W3WAPIKey stored as an environment variable

Usage

1
w3w(x)

Arguments

x

A vector, or list, of words. Strings with dots in them will be split. After splitting, there must be a multiple of three words. Either a vector of words, for a single latitude/longitude pair, or a list of vectors for vectorised operations. This wrapper also accepts a single string of three words separated by full stops.

Value

a numeric vector of length 2, consisting of lat(itude) and lon(gitude)

Examples

1
2
3
4
5
6
7
8
## Not run: 
w3w("president.always.lying")
w3w("unseen.academicals.football") ## returns NAs
w3w(list("special.tools.required", "cliffs.falling.rocks",
         "available.during.winter", "ultraviolet.light.required"))
w3w(c("protests", "memo", "consoles"))

## End(Not run)

Example output

     lat lon
[1,]  NA  NA
     lat lon
[1,]  NA  NA
     lat lon
[1,]  NA  NA
[2,]  NA  NA
[3,]  NA  NA
[4,]  NA  NA
     lat lon
[1,]  NA  NA

geocacheR documentation built on March 26, 2020, 8:57 p.m.