Export an object of class ggmap in R -
i need use map load ggmap in lab there's no internet. wondering if there's read.table function type of object.
this code i'have try:
mtl <- get_map(location = c(lon = -73.705951 , lat = 45.541598), zoom = 11 , maptype = "terrain", source = "google", color = "color") save(mtl, file="mtlmap.rdata") test <- load("mtlmap.rdata") ggmap(test)
and error:
error: ggmap plots objects of class ggmap, see ?get_map
thanks!
perhaps use save
, load
?
myggmap <- get_googlemap(...) #add params here save(myggmap, file="tmp1.rdata") rm(myggmap) load("tmp1.rdata") ggmap(myggmap)
or bit fancier:
if(file.exists("tmp1.rdata")&file.info("tmp1.rdata")$size>0) load("tmp1.rdata")
Comments
Post a Comment