> a<-c(4,6,2,7)
> b<-c(2,1,7,3)
> vec<-c(2,3,4)
> is.element(vec,a) #属于
[1] TRUE FALSE TRUE
> all(a%in%b) #a属于b
[1] FALSE
> intersect(a,b) #a,b的交集
[1] 2 7
> union(a,b) #a,b的并集
[1] 4 6 2 7 1 3
> setdiff(a,b) #b的补集
[1] 4 6
> setdiff(union(a,b),intersect(a,b))
[1] 4 6 1 3