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

前端 未结 1 1711
一向
一向 2021-01-24 07:51

This past summer I was working on a code in R where I used the packages mapview and ggmap. During the summer the code was working fine. This past week

相关标签:
1条回答
  • 2021-01-24 08:41

    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!

    0 讨论(0)
提交回复
热议问题