>
> In fact, this is what is returned by the mapply approach, while the 
> array approach returns the transpose. I gather the 'missing step' is 
> to use aperm, but haven't figured out how to get that to work...yet.

ms <- array(c(rep(0, 3),sa*m,so,sa), c(3, 2, 2))

ms_new <- aperm(ms,c(1,3,2));

for (i in 1:n) { print(ms_new[i,,]) }

      [,1] [,2]
[1,]  0.0 0.96
[2,]  0.5 0.80

      [,1] [,2]
[1,]  0.0 0.96
[2,]  0.5 0.80

      [,1] [,2]
[1,]  0.0 0.96
[2,]  0.5 0.80


>
>
> On 9/28/2017 5:11 AM, Duncan Murdoch wrote:
>> ms <- array(c(rep(0, 5),sa*m,so,sa), c(5, 2, 2)) 
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to