Re: [R] comparing columns in a dataframe

2009-04-05 Thread baptiste auguie
Hi, Have you looked at the compare package? It might do what you want (I just remember seeing its description on R News recently but I've never used it), d <- data.frame(x=1:10,y=sin(1:10),z=factor(letters[1:10])) d1 <- d d1$x[2:3] <- jitter(d$x[2:3] ) d2 <- subset(d1, !(z %in% c("a","g")

Re: [R] comparing columns in a dataframe

2009-04-04 Thread markleeds
Hi: you've got to create a setdiff in both directions in order to get the lone ones in each column because setdiff is not commutative meaning that setdiff(a,b) does not equal setdiff(b,a). once you do that, then ( setdiff1 + setdiff2 - intersect ) should equal the union. if it