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

[R] comparing columns in a dataframe

2009-04-04 Thread Bob Green
hello, I am hoping for some advice regarding comparing variables from 3 versions of a spreadsheet which have been combined into a single dataframe. The aim is to identify which rows have been changed. The dataframe contains 177 rows of data (each cell contains text). 'intersect' produced a f