Maria Jose Juan Jorda <mjuanjorda <at> gmail.com> writes: > > Hello all > > I am a newbie to R plotting maps. I am trying to plot over a world map a > layer of Biogeochemical provinces (BGCP) by A.R. Longhurst. Each ocean > region unfortunately are quite irregular in shape (not perfect squares). In > GIS this layer of ocean provinces would be a layer of polygons, which I am > assuming it cannot be plotted with R. > > I was wondering If anybody has encounter this problem before, to plot a GIS > layer of polygons into a map in R.
The CRAN repository has a tab in the left navigation bar, "Task Views". If you look there, you'll see many guides to subject areas - in your case, choose "Spatial". You will find sections for reading spatial data - if your data can be represented as a shapefile, then reading them is not, in principle, a problem. So the recipe could be as simple as: library(rgdal) BGCP <- readOGR(dsn=".", layer="BGCP") # for the BGCP shapefile files (three or more files) in the working # directory spplot(BGCP, "BGCP") # to plot the column named BGCP in the BGCP object with default # plotting arguments (spplot is in the sp package loaded with rgdal) Hope this helps, Roger ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.