[R] How to determine a subset of a binary strings?
savicky at cs.cas.cz
Mon Feb 20 16:45:53 CET 2012
On Mon, Feb 20, 2012 at 03:15:53PM +0200, jing tang wrote:
> 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?
all(x <= y) #  TRUE
all(z <= y) #  TRUE
all(x <= z) #  FALSE
Hope this helps.
More information about the R-help