I came across the same issue, expecting the same cards to load dozens of times per launch.
You can save any object in R, but it took me a little time to figure out the nuances of saving the map inside the function. Here is what I came up with - I would like to see if there are any improvements that can be made.
Locale ( -, ), . , , . , Google .
, , , .GlobalEnv , R .
load.map <- function(Locale, Lon, Lat, MapZoom){
MapName <- paste("Map", gsub(" ", "", Locale), MapZoom, sep = "")
FileName <- paste(MapName,".RData", sep = "")
if (file.exists(FileName) & ReloadMaps == 0)
{
load(FileName, envir = .GlobalEnv)
} else
{
Map <- get_googlemap(center=c(lon = Lon, lat = Lat), zoom=MapZoom, scale = 2,
size = c(640, 640), maptype = "roadmap", color = "color", format = "png8")
assign(MapName, Map, envir = .GlobalEnv)
save(list = MapName, file = FileName, envir = .GlobalEnv)
}
}