Minus operation of data frames
Clash Royale CLAN TAG #URR8PPP Minus operation of data frames I have 2 data frames df1 and df2 . df1 df2 df1 <- data.frame(c1=c("a","b","c","d"),c2=c(1,2,3,4) ) df2 <- data.frame(c1=c("c","d","e","f"),c2=c(3,4,5,6) ) > df1 c1 c2 1 a 1 2 b 2 3 c 3 4 d 4 > df2 c1 c2 1 c 3 2 d 4 3 e 5 4 f 6 I need to perform set operation of these 2 data frames. I used merge(df1,df2,all=TRUE) and merge(df1,df2,all=FALSE) method to get the union and intersection of these data frames and got the required output. What is the function to get the minus of these data frames,that is all the positions existing on one data frame but not the other? I need the following output. merge(df1,df2,all=TRUE) merge(df1,df2,all=FALSE) c1 c2 1 a 1 2 b 2 Do you want to get lines in df1 that are not in df2 and lines in df2 that are not in df1 ? – juba Apr 22 '13 at 9:39 @juba, I believe this is more of setdiff b...