[R] Getting the difference between two data frames

Ferry fmi.mlist at gmail.com
Thu Feb 19 23:23:45 CET 2009


Dear R users,

I have the following data:
x <- data.frame( myX = c(1,2,3,4,5,6,7,8,9) )
y <- data.frame( myX = c(1,2,3,4,5,6,7) )

How can I get the difference between data frame x and y? In this case,
I want to get values 8 and 9

I know in SQL we can use minus operator, but I have no idea how to do so in R.

I tried all.equal, diff, and identical, but they don't give me the
actual data difference.

Thank you beforehand,

Ferry




More information about the R-help mailing list