-1

我的数据:

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')

目标: 列出「b」有但「a」没有的所有东西」</p>

我尝试:

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"
4

1 回答 1

0

If this is in the R language:

setdiff(b, a)

See also the docs on set operations

于 2015-03-20T16:16:51.743 回答