Using dplyr correctly to combine shared values of a row to a new column of a table

25 Views Asked by At

How do I combine data from two tables based on certain shared values from the row?

I already tried using the which function and it didn't work.

1

There are 1 best solutions below

0
Ian Parzyszek On

I think you will have the best luck using the dplyr fuction. Specifically you can use right_join(). You can wright it like this, right_join(df1,df2, by="specification")

This will combine that columns from df2 with the specifications matching the rows according to the shared specification from df1.

For future reference it would be a lot of help if you included a screenshot of code just so it is easier to know exactly what you are asking.

Anyway, let me know if this answers your question!