Re: [R] Referring to matrix elements by name, iteratively

2012-10-16 Thread AHJ
Thank you both for the suggestion. So this means that when the vector is one of characters the string inside it is interpreted as itself, rather than as an index. That makes so much sense! Thanks again :) -- View this message in context: http://r.789695.n4.nabble.com/Referring-to-matrix-element

Re: [R] Referring to matrix elements by name, iteratively

2012-10-16 Thread AHJ
You are right! But that was my bad, I was trying to simplify the part of the data I used in the example. The real data have exactly the same IDs as both rows and columns. Thanks for catching that. :) -- View this message in context: http://r.789695.n4.nabble.com/Referring-to-matrix-elements-by-

Re: [R] Referring to matrix elements by name, iteratively

2012-10-15 Thread arun
Sent: Monday, October 15, 2012 1:57 PM Subject: [R] Referring to matrix elements by name, iteratively #Here is a vector of IDs > cwaves [1]    86    90  185  196  197  209  210  215  216  217  218 #Here is a matrix. The rows and columns correspond to the IDs in cwaves, and the matrix is

Re: [R] Referring to matrix elements by name, iteratively

2012-10-15 Thread Berend Hasselman
g] On Behalf Of Berend Hasselman >> Sent: Monday, October 15, 2012 2:51 PM >> To: AHJ >> Cc: r-help@r-project.org >> Subject: Re: [R] Referring to matrix elements by name, iteratively >> >> >> On 15-10-2012, at 19:57, AHJ wrote: >> >&

Re: [R] Referring to matrix elements by name, iteratively

2012-10-15 Thread David L Carlson
alf Of Berend Hasselman > Sent: Monday, October 15, 2012 2:51 PM > To: AHJ > Cc: r-help@r-project.org > Subject: Re: [R] Referring to matrix elements by name, iteratively > > > On 15-10-2012, at 19:57, AHJ wrote: > > > #Here is a vector of IDs > > > >> cwav

Re: [R] Referring to matrix elements by name, iteratively

2012-10-15 Thread Berend Hasselman
On 15-10-2012, at 19:57, AHJ wrote: > #Here is a vector of IDs > >> cwaves > [1]8690 185 196 197 209 210 215 216 217 218 > > #Here is a matrix. The rows and columns correspond to the IDs in cwaves, and > the matrix is populated with a coefficient > >> mat > 86 90

[R] Referring to matrix elements by name, iteratively

2012-10-15 Thread AHJ
#Here is a vector of IDs > cwaves [1]8690 185 196 197 209 210 215 216 217 218 #Here is a matrix. The rows and columns correspond to the IDs in cwaves, and the matrix is populated with a coefficient > mat 86 90 185 196 209 210 215 216 217 218 86