Johannes,

How can I transform ls into a RasterBrick? Or is there any function to
> append a new layer to a RasterBrick during each run of the loop (instead of
> collecting the results in a list of rasters)?
>
That is pretty much the representation of a brick, so I'm not sure you'd
gain anything. Simply :
b <- brick(ls)


>
> 2) If I have a final RasterBrick, is there a simple way to exclude a
> single layer, resp. remove it? I am looking for something like indexing?
>
> b <- brick(r1,r2,r3)
> # e.g. something like: b[b!="r2"]
>
> I tend to use something like :
rl <- list(r1, r2, r3)
names(rl) <- c("soil", "veg", "hydro")
b <- brick(rl)
# Now you can make selections e.g.:
plot(b[[c("soil", "hydro")]])

Note that b[[ with two elements returns a stack (not sure why), so you
might want to re-brick it depending of your needs.

Etienne

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to