On Jul 5, 2012, at 1:34 PM, David Winsemius wrote:


On Jul 5, 2012, at 1:25 PM, Eiko Fried wrote:

Hello,

I have many hundred variables in my longitudinal dataset and lots of
missings. In order to plot data I need to remove missings.

If I do
data <- na.omit(data)
that will reduce my dataset to 2% of its original size ;)

So I only need to listwise delete missings on 3 variables (the ones I am
plotting).

data$variable1 <-na.omit(data$variable1)

?complete.cases  # returns a logical vector

data[ complete.cases( data[ , c("var1", "var2", "var3"]) , ]

data[ complete.cases( data[ , c("var1", "var2", "var3") ] ) , ]
Er, need to add a right - paren  -----here  -----------^

--

David Winsemius, MD
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to