Closed ZTaylor205 closed 6 years ago
I see in the help for madness::colSums
:
Note that the sums are flattened to a column vector.
I am not sure why I chose to do that. I seem to remember something repugnant about the differences of colSums
and rowSums
that modifying the output was the only sensible option, but I could be wrong. In the meantime, use assignment into dim
to do the reshape:
set.seed(1234)
test = array(rnorm(15),dim = c(5,5,3))
mt <- madness(test)
cmt <- colSums(mt)
dim(cmt) <- c(5,3)
cmt@val
Also note it is probably not a good idea to rep out the data before stuffing into a madness
object if the data are forced to be equal to each other.
Thanks! I must have missed that warning, and I did not even realize you could use dim() to assign new dimensions.
colSums appears to flatten its results, even when it is not supposed to.
Unfortunately, there is no way to wrap this column back into a 5x3 vector. (I'll post this as its own issue.)
I tried to do a workaround with apply, but this results in a different error: