Sorry, correction:
Try this:
a<-c("NA","1", "NA", "5", "NA", "6","8","10")
x<-c(1:length(a))
**z<-x[a=="NA"]** NOT z<-z[a=="NA"]
At 06:37 PM 11/30/2000 +0100, Marion VERDOIT wrote:
Hello,
I have a vector
a<-c("NA","1", "NA", "5", "NA", "6","8","10")
I want the positions of the "NA"s in a, i.e.:
1 3 5
I try
match("NA", a), but it returns only the first position :
> 1
have you the solution?
Thank you
---------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu. To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message: unsubscribe s-news
---------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu. To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message: unsubscribe s-news
|