Geocoding with ggmap : How to use ggmap's geocoding function in Exploratory

How to use ggmap geocode in Exploratory

You can use ggmap’s geocode feature inside Exploratory to add geocode info to your data frame. And here is how.

Install ggmap

First install ggmap to Exploratory with R Package Installation Dialog

Add Custom Command

Then as a custom step, you can add a step like below that uses mutate_geocode.

ggmap::mutate_geocode(city, output = "latlon", source = "google")

Known Issue

It seems ggmap has an issue that sometime it raises error: is.character(location)

It says the issue is fixed in newer version which is not available on CRAN yet.
So in case you hit the issue, you might want to try to install newer version from github with RStudio like below.

.libPaths(“your_home_directory\.exploratory\R\3.4”) # for windows path style
library(devtools)
devtools::install_github(“dkahle/ggmap”, force=TRUE)

And please restart Exploratory and try it again.

1 Like