As a temporary fix, you can do it yourself. Type of
get_stamenmap
on the R terminal. This will print the code for loading maps. You will need to edit this code and replace the function in the namespace.
Copy the code into a text editor and do it if the function changes the first line again:
get_stamenmap <- function (bbox =
Then you need to go to download jpeg. Search in png and change the text to jpg. I had two instances that looked like the text you need in the file extension, they were on lines 64 and 71 for me.
64: urls <- paste(urls, ".jpg", sep = "") 71: destfile <- paste(filename, "jpg", sep = ".")
Line 75 has a readPNG function that needs to be changed to readJPEG.
tile <- readJPEG(destfile)
You will also need to ensure that the jpeg package is downloaded, that is, the library (jpeg), since ggmap does not otherwise understand that this is necessary now. I also need a library (plyr), but I did not understand why - I did this because I received a later error message ldply (), which I found in this package.
Now insert this "all new" function back into the terminal. After that, you need to overwrite the function built into the package, which is different from the local copy that you just pasted into the terminal, so you need to type this:
assignInNamespace("get_stamenmap",get_stamenmap,ns="ggmap")
You should now be ready to use qmap again. This procedure worked for me and was easier than recompiling the package with the same changes or downloading the latest source that has these fixes and compilation.