Hello, I have a list called ja and I wish to unify list objects if there is some overlap. For instance something like
if (length (intersect (ja[[1]], ja[[2]]) !=0) { union (ja[[1]], ja[[2]] } but of course it should work cumulatively (for larger data sets). Could you please give me a hint. Thanks Hermann > ja $A [1] "A" "B" "F" "G" "H" $B [1] "B" "F" "I" $C [1] "C" "F" "I" "K" $D [1] "D" "L" "M" "N" $L [1] "L" "O" "P" dput (ja) structure(list(A = c("A", "B", "F", "G", "H"), B = c("B", "F", "I"), C = c("C", "F", "I", "K"), D = c("D", "L", "M", "N"), L = c("L", "O", "P")), .Names = c("A", "B", "C", "D", "L")) [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.