Мне было интересно, как мне найти и удалить общие элементы в i+1
-ом векторе списка (в базе R
)?
Например:
x = list(a = 1:5, b = 3:7, c = 6:9) # Initial list
common <- # your solution # ? find common values
for(i in 1:length(x)) {
# your solution: ?create `b` removing common elements with `a`
# your solution: ?create `c` removing common elements with `b`
}