| To: | <s-news@lists.biostat.wustl.edu> |
|---|---|
| Subject: | Exchanging Indices of a Matrix |
| From: | "Quinn, David" <David.Quinn@nrgenergy.com> |
| Date: | Tue, 25 Jun 2002 12:22:52 -0500 |
| Cc: | "Quinn, David" <David.Quinn@nrgenergy.com> |
| Thread-index: | AcIcbO+6Gk3JGvv3RMGKsN2lyuVFgA== |
| Thread-topic: | Exchanging Indices of a Matrix |
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)
{
for (k in 1:z)
{
new.matrix[k,j,i] <- old.matrix[i,j,k]
}
}
}
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Classification of compositional data [summary], Gabriel Baud-Bovy |
|---|---|
| Next by Date: | Visualizing kriging results in Arcview GIS, Miguel Repas |
| Previous by Thread: | Classification of compositional data [summary], Gabriel Baud-Bovy |
| Next by Thread: | Re: Exchanging Indices of a Matrix, Sundar Dorai-Raj |
| Indexes: | [Date] [Thread] [Top] [All Lists] |