Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

[R] A one-liner to create a 3-dim array

Ravi Varadhan

2005-07-25


Hi,



I would like to write a one-line R code to create a 3-dim array, B, of
dimension (n,n,m) from a matrix, A, of dimension (m,n) such that the i-th
element of the 3-dim array, B[, , i] is the outer product of the i-th row
of A.



Thanks for any help,

Ravi.


 [[alternative HTML version deleted]]

______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
©2008 r-help.com - Jax Systems, LLC, U.S.A.