see new notes at 693be1134fd70efb8f726022b001ac336b8463d4
could just be an issue with the labeling of the dimensions in the array output, or could be an issue with the order in which the array is filled
actually, i think i know what the problem is
It is the key of expD, which affects the ordering of expD's rows. When expD[,value] begins to fill the array, expD needs to be ordered according to the dimensions of the array, specifically, setorder(expD, stratum, K, spp); note that I don't think it has to be setorder(expD, s.reg, year, stratum, K, spp) because s.reg and year are already in the by= statement when the array is being filled (well, list of arrays), so that subset happens, ergo the ordering for those columns would not matter. Currently, in this particular case, expD is explicitly ordered to s.reg, year, K, and then some residual ordering from past steps. Because stratum has to take precedent over K in the ordering, this would guarantee that expD was not properly ordered when it fills the output array.
see new notes at 693be1134fd70efb8f726022b001ac336b8463d4
could just be an issue with the labeling of the dimensions in the array output, or could be an issue with the order in which the array is filled
actually, i think i know what the problem is
It is the key of
expD
, which affects the ordering ofexpD
's rows. WhenexpD[,value]
begins to fill the array,expD
needs to be ordered according to the dimensions of the array, specifically,setorder(expD, stratum, K, spp)
; note that I don't think it has to besetorder(expD, s.reg, year, stratum, K, spp)
becauses.reg
andyear
are already in theby=
statement when the array is being filled (well, list of arrays), so that subset happens, ergo the ordering for those columns would not matter. Currently, in this particular case,expD
is explicitly ordered tos.reg, year, K
, and then some residual ordering from past steps. Becausestratum
has to take precedent overK
in the ordering, this would guarantee thatexpD
was not properly ordered when it fills the output array.I think that's the fix.