How to clip WorldMap with polygon in R?
问题 I have imported a world map dataset from www.GADM.org using the R package raster. I would like to clip it to a polygon I create to reduce the size of the map. I can retrieve the data and I can create the polygon no problem, but when I use the 'gIntersection' command I get an obscure error message. Any suggestions on how to clip my World Map dataset? library(raster) library(rgeos) ## Download Map of the World ## WorldMap <- getData('countries') ## Create the clipping polygon clip.extent <- as