Skip to content
Prev 19559 / 29559 Next

Any reason to not use brick() on a single-band raster?

R-sig-geo'ers:

I was curious: is there any practical reason to not use brick() on a
single-band raster (efficiency hits, for instance)?  The reason I'm
asking is that I'm working on some functions that return a single or a
multi-band output, and rather than doing an if(nlayers(x)==1)
raster(x) else brick(x); I was going to make it easier and just always
returning brick(x).

--j