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!!