Re: [R] Getting wrong NA values using "for" cmd

2011-07-09 Thread Uwe Ligges
On 08.07.2011 18:20, VictorDelgado wrote: ty S. Goslee, It's helpfull to test the condition: all.equal(s[4],0.15) [1] TRUE instead the previous "FALSE" answer obtained with s[4]==0.15 [1] FALSE but I still need get it to vector r: Victor Delgado wrote: for (w in 1:length(s)){ r[w]

Re: [R] Getting wrong NA values using "for" cmd

2011-07-08 Thread VictorDelgado
ty S. Goslee, It's helpfull to test the condition: > all.equal(s[4],0.15) [1] TRUE instead the previous "FALSE" answer obtained with >s[4]==0.15 [1] FALSE but I still need get it to vector r: Victor Delgado wrote: > > >> for (w in 1:length(s)){ >> r[w] <- dados[,3][dados[,2]==s[w]][1] >> }

Re: [R] Getting wrong NA values using "for" cmd

2011-07-08 Thread Sarah Goslee
Looks like FAQ 7.31 to me. Try all.equal() instead of ==. Sarah On Fri, Jul 8, 2011 at 11:06 AM, VictorDelgado wrote: > Hi There, > > I'm facing one problem to construct a vector using the "for" command: > > I have one matrix named 'dados' (same as /data/ from portuguese), for > example: > >> d

[R] Getting wrong NA values using "for" cmd

2011-07-08 Thread VictorDelgado
Hi There, I'm facing one problem to construct a vector using the "for" command: I have one matrix named 'dados' (same as /data/ from portuguese), for example: > dados[140:150,] [,1] [,2] [,3] [1,] 212.7298 0.14 0.11 [2,] 213.3778 0.14 0.11 [3,] 214.0257 0.15 0.11 [4,] 214.6737 0.1