Hi Jonathan, You can do it by accessing the layers slot:
data_sub=stack( data_st...@layers[10:20] ) But I like better what you tried to do, and will implement that. Robert On Thu, May 27, 2010 at 3:55 PM, Jonathan Greenberg <greenb...@ucdavis.edu> wrote: > I'm thinking I'm missing something obvious -- if I want to make a new > raster stack which is a subset of another raster stack, how do I go > about doing this? Neither of these worked: > > data_sub=stack(data_stack,bands=c(10,20)) > data_sub=stack(data_stack,index=c(10,20)) > > data_stack is a rasterStack of 1500 layers... > > Thanks! > > --j > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo