# Setting up the data
data("Brazil_epiflows")
data("YF_coordinates")
get_coordinates(Brazil_epiflows) # no coordinates yet
ef <- add_coordinates(Brazil_epiflows, YF_coordinates[-1])
get_coordinates(ef)
get_coordinates(ef, location = "Espirito Santo") # coordinates for Espirito Santo
if (interactive()) {
# You can use google maps' geocode functionality if you have a decent
# internet connection
# NOTE: you may need to authenticate with Google Maps API beforehand
# using ggmap::register_google()
ef2 <- add_coordinates(Brazil_epiflows, loc_column = "id")
ef2
}
Run the code above in your browser using DataLab