Full_Name: Lutz Prechelt Version: 2.4.1 OS: Windows XP Submission from: (NULL) (160.45.111.67)
'union' ignores the fact if its arguments are factors while all other set operations (intersect, setdiff, setequal, is.element) treat them sensibly. The manpage does not even mention the term 'factor'. Example: f1=factor(c("a","b","b","c")); f2=factor(c("a","d","d","e")); print(union(f1,f2)); print(intersect(f1,f2)); print(setdiff(f1,f2)); print(setequal(f1,f2)); print(is.element(f1,f2)) prints [1] 1 2 3 [1] a Levels: a d e [1] b c Levels: a b c [1] FALSE [1] TRUE FALSE FALSE FALSE ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel