-1

My data:

a <- c('KK','LL','II','JJ','AA','CC','GG','FF','EE','QQ','ZZ','XX')
b <- c('CC','GG','FF','EE','KK','LL','II','JJ','QQ','ZZ','XX','BB','AA','OO','WW')

target: list all of the things that which 「 "b"have but "a" don't have 」

I try :

union(a,b)

[1] "KK" "LL" "II" "JJ" "AA" "CC" "GG" "FF" "EE" "QQ" "ZZ" "XX" "BB" "OO"
[15] "WW"

intersect(a,b)

[1] "KK" "LL" "II" "JJ" "AA" "CC" "GG" "FF" "EE" "QQ" "ZZ" "XX"
Jonathan Eunice
  • 21,653
  • 6
  • 75
  • 77
fish
  • 23
  • 1
  • 1
  • 6

1 Answers1

0

If this is in the R language:

setdiff(b, a)

See also the docs on set operations

Jonathan Eunice
  • 21,653
  • 6
  • 75
  • 77