[R-sig-Geo] How to extract the first 10 rows in a rasterstack?

Robert J. Hijmans r.hijmans at gmail.com
Sun Nov 17 20:58:44 CET 2013


Eddie,

You can have a look at this
http://cran.r-project.org/web/packages/raster/vignettes/Raster.pdf

and this:
?getValues

Robert

On Mon, Nov 11, 2013 at 11:53 AM, Eddie Smith <eddieatr at gmail.com> wrote:
> Dear list,
>
> I am working with such a huge rasterstack. Is there any possibilities that
> we could extract the pixel values chunk by chunk?
>
> The extract command below took nearly 7 hours.
>
> library(raster)
> r <- raster(nrow=1000, ncol=1000)
> s <- stack( sapply(1:366, function(i) setValues(r, rnorm(ncell(r), i, 3) ))
> )
> Pixels<-extract(s,1:ncell(s))
>
> Thanks in advance.
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list