# NOT RUN {
set_key("YOUR_GOOGLE_API_KEY")
df <- google_geocode(address = "MCG, Melbourne, Australia",
simplify = TRUE)
df$results$geometry$location
lat lng
1 -37.81659 144.9841
## using bounds
bounds <- list(c(34.172684,-118.604794),
c(34.236144,-118.500938))
js <- google_geocode(address = "Winnetka",
bounds = bounds,
simplify = FALSE)
## using components
components <- data.frame(component = c("postal_code", "country"),
value = c("3000", "AU"))
df <- google_geocode(address = "Flinders Street Station",
components = components,
simplify = FALSE)
# }
Run the code above in your browser using DataLab