Is something wrong with the ggmap and mapview packages in R?

我只是一个虾纸丫 提交于 2019-12-02 06:37:57

Google has tightened controls on API access to Google Map products. This means that you now need a Google API key to use ggmap().

There are a few steps involved:

  1. Visit https://console.cloud.google.com and create a new project.
  2. Set up an API key: navigation menu -> APIs and services -> Library -> Maps Static API
  3. Create a billing account and enable billing for the API key. You will need to provide credit card details but don't need to pay anything. It is a good idea to set some limits on how the API key can be used to prevent theft -- if you are not sharing your code, the easiest way is probably to limit it to requests from your own IP address.
  4. Enable static maps for this api key.
  5. In R, run register_google("<your API key>"). You will need to run this for every new session in which you will use ggmap(). I have added it to my .Rprofile.

Good luck!

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!