Skip to content
Prev 27794 / 29559 Next

raster: stackApply problems..

Thank you!
The problem is not with the resulting values ??but with the index
mapping. Values ??are correct in all three cases.

As I wrote in a previous post in the thread
(https://stat.ethz.ch/pipermail/r-sig-geo/2019-November/027821.html) ,
stackApply behaves inconsistently depending on whether the exported
stack will remain in memory or it will be stored, due to its large size,
on the hard disk.

In the first case the indices are identical to my function (ver_mean)
and the lubridate::wday indexing system (and are correct) while in the
second they are shuffled.

So, while Sunday has index 1 and while in the first case (when the
result is in memory) stackApply returns the correct index, in the second
case (when the result is stored on the hard disk) it returns index_4! So
how can one be sure if index_1 corresponds to Sunday or another day
using stackApply since it sometimes enumerates it with index_1 and
sometimes index_4?


Try to run this example (when the resulting stack remains in memory) to
see that the indexes are identical (stackApply = ver_median =
lubridate::wday)
https://gist.github.com/kokkytos/5d554b5a725bb48d2189e2d1fa0e2206

Thank you again
On 11/26/19 9:00 PM, Vijay Lulla wrote: