basically I have 2 data frames with this basic structure:
Col1 | Col2 | Col3 | Col4 |
---|---|---|---|
aaa | 12 | xxx | 32b |
tfe | 21 | xxx | 14f |
eed | 12 | xxx | 54b |
wes | 95 | xxx | 54r |
rtf | 44 | xxx | 99q |
fvg | 87 | xxx | 55h |
So some of the values in column 1 are repeated in both data frames and I wanted to make a new data frame with only the rows with unique values in Col1 for each dataframe, so in psuedo-code:
Unique_to_df1 <- df1[Unique_Function(find rows with Col1 values not in df2)] Unique_to_df2 <- df2[Unique_Function(find rows with Col1 values not in df1)]
I have tried a few functions, but they all either seem to only export the unique values of Col1, not the whole table or only seem to work with removing.extracting duplicate values from one data frame, not comparing between two. Any help/suggestions would be greatly appreciated!
setdiff
– GKi