One of the fun things you can do with maps in R is make rasters and shapes that plot on Google Earth. All you really need to do is convert your spatial data to lon-lat coordinates then use one of the KML packages to save the layer as a KML, which can then be viewed in Google Earth. Here is a screen shot of an example from data in my R spatial course.
library(raster) library(rgdal) library(plotKML) rseagrass <- raster('raster seagrass.grd')
rsg.ll <- projectRaster(rseagrass, crs = "+proj=longlat +ellps=WGS84", method = 'ngb')
We are using the nearest neighbour (
'ngb') interpolation here, because the seagrass raster is categorical (0/1 for absence/presence of seagrass).
sgcols <- c('lightblue', 'seagreen') KML(rsg.ll, 'Seagrass_MoretonBay', col = sgcols)