[R-sig-Geo] rastrer::raster no extent argument?

Agustin Lobo alobolistas at gmail.com
Wed Jun 15 16:26:03 CEST 2011


Hi!

In order to define an arbitrary test raster object, I thought I could do:
> foo4 <- raster(nrows=20, ncols=20,crs=NA,extent=c(0,20,0,20))
> values(foo4) <- runif(400,-100,150)

but extent is not a valid argument, so I use another step
> foo4 <- raster(nrows=20, ncols=20,crs=NA)
> values(foo4) <- runif(400,-100,150)
> extent(foo4) = extent(c(0,20,0,20))

Would not make sense adding this feature to raster() itself?

Agus



More information about the R-sig-Geo mailing list