0

I have two data frames. Each has a common column: SubID. However, in the first data frame (we'll call it df1), SubID looks like this: 1, 1, 1, 2, 2, 2, 3, 3, 3,... and so on. In the second data (df2), SubID is just 1, 2, 3, etc. There is a column (let's call it colOfinterest)in df2 that I want added to df1, but it would need to be in triplicates.

How can I create an argument, something like, "if df2$SubID = 1 then rowbind df2$colOfinterest to df1 whenever df1$SubID = 1)

Thank you!!

Katie S
  • 11
  • 1
    `merge(df1, df2)` should do it. If you need more help, please [provide a reproducible example](https://stackoverflow.com/q/5963269/903061). – Gregor Thomas Aug 20 '18 at 16:19
  • @whoever downvoted, no reason to downvote a question from a brand new user, one that shows a pretty clear problem description even if it's lacking a reproducible example. – Gregor Thomas Aug 20 '18 at 16:24

0 Answers0