say 'data' is your data.frame, then try this:
data[!is.na(data$a), ]
I hope it helps.
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
Quoting Jan Ivanouw <ivanouw@post8.tele.dk>:
I am sorry I can't find the solution to this simple problem. Can anyone help?
I have a (large) data frame with missing values, like this:
a b c
1 3 5
NA 9 2
3 5 2
NA 8 6
5 3 7
Based on non-missing values of variable a, I want it changed to
a b c
1 3 5
3 5 2
5 3 7
Thank you
Jan Ivanouw PhD
University of Copenhagen
Denmark
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
|