On Nov 30, 2012, at 9:27 AM, ramoss <ramine.mossad...@finra.org> wrote:

> Hello,
> 
> I have a variable in a data frame that contains NA values. I just want to
> subset so that I get the obs where that variable is missing.
> In SAS I would do:
> 
> data missing;
>  set test;
>  if myvalue=' ';
> run;
> 
> How can I perform this simple task in R?
> 
> Thanks in advance for your help. 


The easiest is probably:

  NewDF <- subset(DF, is.na(myvalue))

See ?is.na

Regards,

Marc Schwartz

______________________________________________
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