# How to determine a subset of a binary strings?

4 messages
Open this post in threaded view
|

## How to determine a subset of a binary strings?

 Hi, I need some neat ways of determing a subset of binary strings. For example, x=c(0,0,1), y=c(0,1,1), z=c(0,1,0). So x is a subset of y and z is also a subset of y, but x is not a subset of z. I tried to search R functions and packages but no hits. Any ideas?   Best, Jing   -- Jing Tang, PhD Senior Researcher Finnish Institute of Molecular Medicine (FIMM) FI-00014 University of Helsinki Finland             [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|

## Re: How to determine a subset of a binary strings?

 On 20-02-2012, at 14:15, jing tang wrote: > Hi, > > I need some neat ways of determing a subset of binary strings. For example, > x=c(0,0,1), y=c(0,1,1), z=c(0,1,0). So x is a subset of y and z is also a > subset of y, but x is not a subset of z. > > I tried to search R functions and packages but no hits. Any ideas? x <- c(0,0,1) y <- c(0,1,1) z <- c(0,1,0) any(x & y) any(z & y) any(x & z) Berend ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.