Last chance! 50% off unlimited learning
Sale ends in
rasterToPolygons(x, fun=NULL, n=4, na.rm=TRUE, digits=12)
x
has a single layerTRUE
, cells with NA
values in all layers are ignoredfun
should be a simple function returning a logical value
e.g.: fun=function(x){x==1}
or fun=function(x){x>3 & x<6}< code="">
r <- raster(nrow=18, ncol=36)
r[] <- runif(ncell(r)) * 10
r[r>8] <- NA
pol <- rasterToPolygons(r, fun=function(x){x>6})
#plot(r)
#plot(pol, add=T, col='red')
Run the code above in your browser using DataLab