This is apparently the main question, I apologize in advance if this is a duplicate question. I looked around and saw nothing.
I have two data frames full of rows. I would like to see if they are exact duplicates of each other.
If this is not the case, I would like to determine which values are different.
In particular, given this data frame:
| x | y |
|---|---|
| a | e |
| b | f |
| c | g |
| d | h |
and this data file:
| x | y |
|---|---|
| a | l |
| b | m |
| j | g |
| k | h |
I would like to generate this result (df, full of inappropriate values):
| x | y |
|---|---|
| | l |
| | m |
| j | |
| k | |
This question is very close to what I think, but he wants to find complete strings that are the same, not the values.
1) , , , , . , df1 %in% df2 . ?
2) , , . , .
, , , . .
:
df1 <- data.frame(
x = c('a', 'b', 'c', 'd'),
y = c('e', 'f', 'g', 'h')
)
df2 <- data.frame(
x = c('a', 'b', 'j', 'k'),
y = c('l', 'm', 'g', 'h')
)