tidy_geocode: Returns geographical information as a tibble through the use...

View source: R/tidy_geocode.R

tidy_geocodeR Documentation

Returns geographical information as a tibble through the use of a geocoding API

Description

Returns geographical information as a tibble through the use of a geocoding API

Usage

tidy_geocode(df, location, info = c("lat", "lng"), method = "opencage")

Arguments

df

a tibble

location

the variable to geocode

info

the variables to inform Information can be many other variables depending on the method you are using. Type help(geocode_google) or help(geocode_opencage) (according to the method you wish to use) to see details.

method

the API to send the request to. Can be "opencage" (default) or "google".

Value

tibble with additional columns corresponding to the info required

Examples

mydf <-tibble::tibble(location=c("Lyon, France",
                                 "22 place du Général de Gaulle, Paris",
                                 "la Guillotière, Lyon",
                                 NA,
                                 "Europe",
                                 "Tucson, AZ",
                                 "Rio Grande do Sul",
                                 ""))
tidy_geocode(mydf,location,method="opencage")

lvaudor/mixr documentation built on April 14, 2024, 2:17 p.m.