[R-sig-Geo] question about stack command

Edzer Pebesma edzer.pebesma at uni-muenster.de
Tue Dec 4 12:08:27 CET 2012


Michela,

there are options that come fairly close:

What you could do is add columns to a SpatialPixelsDataFrame:

a$colb = b$col
a$colc = c$col

but of course you need to check yourself that this make sense (i.e. the
pixels of a, b and c are identical).

Another way would be working with SpatialGridDataFrame's:

fullgrid(a) = TRUE
fullgrid(b) = TRUE
fullgrid(c) = TRUE

abc = cbind(a,b,c)

which combines layers into one object (similar to what raster::stack
does), and does check for equality of all grid topologies.

Best regards,

On 12/04/2012 11:34 AM, Michela Giusti wrote:
> Hello everybody,
> 
> I have many "SpatialPixelsDataFrame" in my R project and I am wondering
> if there is a command like the command "stack" for raster to do the same
> with this object class.
> Can you help me?
> Thank you.
> Bye,
> 
> Michela
> 

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      e.pebesma at wwu.de



More information about the R-sig-Geo mailing list