tidygeocoder (version 0.2.5)

geocode: Geocode street addresses in a dataframe

Description

Takes a dataframe containing addresses as a input. Returns the dataframe with latitude and longitude coordinate columns using a user specified geocoder function.

Usage

geocode(.tbl, address, method = "census", lat = lat, long = long, ...)

Arguments

.tbl

dataframe

address

name of column containing addresses in .tbl

method

the geocoder function you want to use

  • "census": geo_census - can only handle US street level addresses

  • "osm": geo_osm - more versatile than Census but has a usage limit

  • "cascade": geo_cascade - first tries to use census then tries osm

lat

name of latitude field

long

name of longitude field

...

arguments supplied to the relevant geocoder function

Value

input dataframe (.tbl) with latitude and longitude fields appended

Details

See example usage in vignette("tidygeocoder")

Examples

Run this code
# NOT RUN {
library(dplyr)
sample_addresses %>% geocode(addr)

sample_addresses %>% geocode(addr,method='cascade',lat=latitude,long=longitude)
# }

Run the code above in your browser using DataLab