knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
A simple and fast city-level geocoder and reverse geocoder for the US...
You can install the development version from GitHub with:
# install.packages("remotes") remotes::install_github("cjtexas/citygeocoder")
library(citygeocoder) citygeocoder::geocode("Austin", "TX")
library(citygeocoder) citygeocoder::reverse_geocode(lon = -98.7654321, lat = 34.56789)
df1 <- read.table( text = "City | State Scranton | PA Oakland | CA New York | NY Columbus | IN", header = T, sep = "|", stringsAsFactors = FALSE, strip.white = TRUE ) citygeocoder::geocode(df1$City, df1$State) df2 <- read.table( text = "Lon | Lat -95.55555 | 37.77777 -96.66666 | 36.66666 -97.77777 | 35.55555 -98.88888 | 34.44444 -99.99999 | 33.33333", header = T, sep = "|", stringsAsFactors = FALSE, strip.white = TRUE ) reverse_geocode(df2$Lon, df2$Lat)
citygeocoder:::shiny_example()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.