localgeo is a package that coverts a US City+State to lon/lat. This is a ridiculously
small package and is really just a function interface over the cities.rda
file in the
data
directory. So, just grab that if you want to wrap your own work around it.
It was made in response to http://stackoverflow.com/a/27868207/1457051 since there's no reason to waste bandwidth or cycles on an internet API when you can have the data locally.
The following functions are implemented:
geocode
: converts US city/states to lon/latdevtools::install_github("hrbrmstr/localgeo")
options(width=120)
library(localgeo) # current verison packageVersion("localgeo") print(geocode("Eliot", "ME")) print(geocode(city=c("Houston", "Pittsburgh"), state=c("TX", "PA")))
library(localgeo) library(testthat) date() test_dir("tests/")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.