Coralie
Coralie

Reputation: 231

ggmap error : 'get_openstreetmap' is defunct

I'm trying to build a map on R with ggmap library and an osm background however I get the bellow error.

library(ggmap) library(osmdata) library(devtools)

mad_map <- get_map(getbb("Limete, Kinshasa"), maptype = "terrain", source = "osm")

Erreur : 'get_openstreetmap' is defunct.Use 'OSM is at least temporarily not supported, see https://github.com/dkahle/ggmap/issues/117.' instead.

See help("Defunct")

Upvotes: 3

Views: 2103

Answers (2)

user16605537
user16605537

Reputation:

The solution suggested by pbraeutigm works for me too, so the issue might be on a broader scale. Can you provide some information about your R version, package versions, and operating system?

Upvotes: 0

pbraeutigm
pbraeutigm

Reputation: 723

For me your code is working. try update your librarys. You can update them through: install.packages, just copy my code. I think you don't need "source =", if you use "osm" but your code still works.

install.packages("ggmap")
library(ggmap)

install.packages("osmdata")
library(osmdata) 

install.packages("devtools")
library(devtools)

mad_map <- get_map(getbb("Limete, Kinshasa"), maptype = "terrain", source = "osm")
ggmap(mad_map)

Upvotes: 0

Related Questions