0

I'm working in R project. The table looks like this :

| x | o | o | x | 120
| x | x | x | o | 115
| o | o | o | x | 100

And another table :

| 1 | o | o | o | x |
| 2 | x | x | x | o |
| 3 | o | x | o | x |
| 4 | o | o | o | o |

My question is, how to combine it so :

| 1 | o | o | o | x | 100
| 2 | x | x | x | o | 115

It's ok if the first column isn't sorted. If the x o x o are same, it's joined. Any idea?

Tiara
  • 156
  • 2
  • 15
  • 3
    You can do a `merge` with the four columns and then do `aggregate` i.e. `df3 <- merge(df1, df2, by = names(df1)[1:4])` Regarding the aggregate part do you need to get the `sum`. From the data, it is showing only a single row – akrun Jan 21 '19 at 10:23
  • 1
    Agree with @akrun. This is an inner join. – s_baldur Jan 21 '19 at 10:35

0 Answers0