Skip to content
Prev 19543 / 29559 Next

Creating a maximum raster layer from RasterStack

Hi Agus,

Yes, you are right, in that case stackApply is faster (but note that
you had a mistake in the indices argument that further increased the
difference ---- but is another reason why I would not use stackAppy
unless I really needed it).  I did not think it would be possible that
a more generic function could be faster.  This helped me to find an
inefficiency that occurs when using 'max', that does not occur in
'stackApply'. I have now fixed that (raster version 2.1-59) such that
I get:
Loading required package: sp
user  system elapsed
   1.56    0.28    1.84
user  system elapsed
   1.25    0.29    1.54
user  system elapsed
  13.22    2.22   16.48
user  system elapsed
  12.15    2.03   14.29

That is, speeds are still about the same. That is disappointing.
Thanks for pointing this out.

Robert
On Tue, Oct 15, 2013 at 11:36 PM, Agustin Lobo <alobolistas at gmail.com> wrote: