[R-sig-Geo] How to draw grid contours within a map
Robert Hijmans
r.hijmans at gmail.com
Tue Feb 15 19:05:34 CET 2011
> In order to illustrate the spatial domain of the General Circulation Model
(GCM) output data I am using, I
> need to display some grids within a map. They need to be 2.5°x2.5° lat-lon
> over specific coordinates.
> Following, I create the "empty" grids to draw:
>library(raster)
>rprecip<-raster(xmn=-60,xmx=-50,ymn=-35,ymx=-25)
>res(rprecip)<-2.5
Thiago,
You can do this
rprecip[] <- 1
# (set cells you do not want to NA)
p <- rasterToPolygons(res)
plot(p)
Robert
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/How-to-draw-grid-contours-within-a-map-tp6027387p6028652.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
More information about the R-sig-Geo
mailing list