- 1. Exchanging Indices of a Matrix (score: 1)
- Author: "Quinn, David" <David.Quinn@nrgenergy.com>
- Date: Tue, 25 Jun 2002 12:22:52 -0500
- Is there an easy way to do the following without the looping? I'm guessing not, since I think the internal representation of a matrix is as a list. -- Thanks, David for (i in 1:x) { for (j in 1:y) {
- /archives/html/s-news/2002-06/msg00203.html (7,816 bytes)
- 2. Re: Exchanging Indices of a Matrix (score: 1)
- Author: Sundar Dorai-Raj <sundar.dorai-raj@pdf.com>
- Date: Tue, 25 Jun 2002 12:43:34 -0500
- Looks like you need transpose. Or do you need something more general? + for(j in 1:3) { + for(k in 1:4) { + B[k,j,i] <- A[i,j,k] # your way + } + } + } [1] T -- Sundar Dorai-Raj, Ph.D. Statistical M
- /archives/html/s-news/2002-06/msg00205.html (8,607 bytes)
- 3. Re: Exchanging Indices of a Matrix (score: 1)
- Author: "Quinn, David" <David.Quinn@nrgenergy.com>
- Date: Tue, 25 Jun 2002 12:54:06 -0500
- Thanks for the answers. All I am doing below is transposing t(). (somehow this didn't occur to me.) But in general I could use permutation aperm(). As Win Lambert and Brian Ripley points out, these f
- /archives/html/s-news/2002-06/msg00207.html (8,293 bytes)
- 4. Re: Exchanging Indices of a Matrix (score: 1)
- Author: ripley@stats.ox.ac.uk
- Date: Tue, 25 Jun 2002 18:48:06 +0100 (BST)
- guessing not, since I think the internal representation of a matrix is as a list. -- Thanks, David Yes, see ?aperm. The internal representation of an array (and also of matrices but those only have t
- /archives/html/s-news/2002-06/msg00208.html (8,424 bytes)
- 5. Re: Exchanging Indices of a Matrix (score: 1)
- Author: "Jeffrey Wang" <jwang@insightful.com>
- Date: Tue, 25 Jun 2002 11:05:22 -0700
- Use the aperm() function for transposing an array. =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* Jeffrey Wang Research Scientist Insightful Corp. (206) 802-2269 Is there an easy way to do the following
- /archives/html/s-news/2002-06/msg00209.html (8,401 bytes)
This search system is powered by
Namazu