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
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-
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
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:
>>
>&
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
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
#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
7 matches
Mail list logo