I am trying to filter all the characters that are present in a that are not present in b and c. I want to do this from the list l.
a<-c("A", "B", "C", "D", "E")
b<-c("A", "E", "I", "O", "U")
c<-c("H", "E", "L", "L", "O")
l<-list(a,b,c)
So the answer should be BCD.
>Solution :
you can try the code below
> d <- table(stack(setNames(l, seq_along(l))))
> row.names(d)[d[, 1] == 1 & rowSums(d) == 1]
[1] "B" "C" "D"
``