Searching on Google Maps using RStudio

Searching on Google Maps using RStudio


Today I’ve just faced one challenge… I work on one project, and we need to decide which assets of our company will be repaired initially. As every project, we have limited budget, so we should find some variables to indicate a priority scale. After some discussion, someone said: let’s find the assets close to schools and hospitals. Those must be repaired firstly than others. Everybody agreed with the voice, but how would be possible to map every school and hospital close to 19,000 assets? To answer that question, I would like to introduce the googleway’s library for RStudio.

To use it, you have to get a google’s API key (Google API)

After that, you have to install googleway library in your RStudio, call that library as you see in the picture bellow. The variable df_places will save the results for this search. I’m setting hospital as the key word, one lat and long to start as reference, radius in meters (max = 50,000m), and key is the key you got from google API.

The best part is just to come. When you call the results, you will see the firsts 20 closest places from the location you insert, the name, address and lat/long of those places.

I hope this post help you. If anyone has any doubt, please contact me.

Link: Searching on Google Maps using RStudio