[R] Question about subset

David Winsemius dw|n@em|u@ @end|ng |rom comc@@t@net
Mon Apr 9 06:33:41 CEST 2018



Sent from my iPhone

> On Apr 8, 2018, at 9:06 PM, Sebastien Bihorel <sebastien.bihorel using cognigencorp.com> wrote:
> 
> Hi,
> 
> The help page for subset states "subset: logical expression indicating elements or rows to keep: missing values are taken as false."
> 
> Before I try to re-invent the wheel, I would like to know if one of the base or recommended packages would contain a variant of the subset function that would consider missing values as true.
> 
Just use a Boolean expression 

is.na(col)|(col==0)

> Thanks
> 
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.




More information about the R-help mailing list