I have two vectors (sets) like this:
first<-c(1,2,3,4,5) second<-c(2,4,5)
how can i determine if a secondsubset firstor not? is there a function for this?
second
first
Here is one way
> all(second %in% first) [1] TRUE
Here is another
setequal(intersect(first, second), second) ## [1] TRUE
or
all(is.element(second, first)) ## [1] TRUE