Hi Ben,
Thanks for the clear explanation. First thing is please try updating nimble if you haven't done so recently. There was a bug fix for 0.12-2 that might fix this case.
If that doesn't work, I'd suggest doing it like this:
y.event <- nimArray(dim = c(M.both, J, 3), init=FALSE)
for(i in 1:3) {
y.event[1:M.both, 1:J, i] <- model$y.event[t,1:M.both,1:J, i] # "chipping" or subsetting down to 2D from the original 3D should allow the assignment to work.
}
Then do your work with y.event and use a similar for-loop to put values back into the model if needed.
Alternatively you can work with values directly out of the model in 2D subsets (i.e. not even making a copy) if needed.
Here is what I think is confusing about the messages. nimble can do element-wise math with anything up to 2D, including 2D chips of higher-dimensional objects. Assignment is included in "doing math". So the y.full line of your first message worked because you have a 2D subset of a 3D object, so it could do the assignment. Now, actually *assignment* for higher dimensional objects is the one kind of operation that is, or was supposed to be, supported. However there was a recent bug where in some situations it wouldn't work, and that was fixed. I think that fix will cover your case, but from only looking at it briefly I am not sure and could be wrong (please let me know!). So a solution is to access the higher dimension object using indexing to get down to 2 or fewer dimensions at a time, including for copying. I hope that helps.
-Perry