Skip to content

How to save google map in r ?

3 messages · Kristi Glover, Bert Gunter, Rui Barradas

#
Hi R users,
I am struggling to save the map with georeferenced (TIFF) that was imported from google map. I would be very grateful with your input. How can I save this image and reuse it when I need? I used the following code
library(ggmap)
library(mapproj)
map <- get_map(location = 'Europe', zoom = 4)
ggmap(map)
writeRaster(map, filename = "texting.tif")

but got the following message

"Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ?writeRaster? for signature ?"gg", "character"?"

thanks
#
Please use search facilities before posting such questions here.

I searched on "How to save google map in R" at rseek.org and got many
relevant hits.

If you have *already* done this, you should tell us why what you got did
not suffice.

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Sun, Nov 17, 2019 at 1:48 AM Kristi Glover <kristi.glover at hotmail.com>
wrote:

  
  
#
Hello,

See the docs: get_amp returns a ggmap object and ggmap returns a ggplot 
object. So ggsave() should do what you want.


Hope this helps,

Rui Barradas

?s 09:48 de 17/11/19, Kristi Glover escreveu: