Skip to content
Prev 18261 / 29559 Next

Drawing lines in raster cells

Lionel, perhaps this is what you are after. Robert

library(raster)
library(rgeos)

r <- raster(ncols=10,nrows=10)
set.seed(0)
r[] <- sample(0:1,100,replace=TRUE)

p <- rasterToPolygons(r, fun=function(x){x==1}, dissolve=TRUE)

plot(r)
plot(p, add=T, density=4)
On Sun, May 12, 2013 at 8:49 AM, Lionel <s6lihert at uni-bonn.de> wrote: