get_map not passing the API key (HTTP status was '403 Forbidden')

后端 未结 4 864
别跟我提以往
别跟我提以往 2020-11-28 12:27

I have been facing this issue in the get_map() function (ggmap library) in R.

My code was running without the need to specify an API key

4条回答
  •  感动是毒
    2020-11-28 12:44

    Just adding to @Roman's response, here's the code that worked for me:

    if(!requireNamespace("devtools")) install.packages("devtools")
    devtools::install_github("dkahle/ggmap", ref = "tidyup")
    library(ggmap)
    register_google(key = "your_API_key") 
    usa<- get_googlemap(location='united states', zoom=4,maptype = "hybrid")
    

    For more information you could refer to the library page on github: here
    Hopefully it helps!

提交回复
热议问题