geocode: Geocode a US City & State to a lon/lat pair

Description Usage Arguments Value Examples

Description

Using data from the shapefile in http://www.mapcruzin.com/fcc-wireless-shapefiles/cities-towns.zip this functon geocodes one more more city/state combos into lon/lat pairs. Since it uses mapply for the vectorization, you can either pass in equal length vectors for city and state or pass in a vector of cities/towns in city and a single state in state. See the examples if that's confusing.

Usage

1
geocode(city, state)

Arguments

city

vector of cities to geocode

state

vector of states to geocode

Value

a data.frame of successfully geocoded entries

Examples

1
2
3
4
5
6
7
## Not run: 
geocode("Berwick", "ME")
geocode(c("Portland", "Berwick", "Alfred"), "ME")
geocode(city=c("Baltimore", "Pittsburgh", "Houston"),
        state=c("MD", "PA", "TX"))

## End(Not run)

hrbrmstr/localgeo documentation built on May 17, 2019, 5:10 p.m.