try:
which(x == 0)
Best,
Dimitris
----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
http://www.student.kuleuven.be/~m0390867/dimitris.htm
----- Original Message -----
From: "Mu Tian" <muster at gmail.com>
To: "R-Help" <r-help at stat.math.ethz.ch>
Sent: Thursday, June 01, 2006 5:06 PM
Subject: [R] simple index question
>I want to get index number of 0s, like
>
> x <- c(1, 2, 0, 3, 0, 4)
>
> I want an output of
>
> 3, 5
>
> Thank you.
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm