Joining columns of two data frames column-wise

dplyr

#1

Hi all,

I am a beginner in R, and this is my first post in RStudio community. I want to concatenate two data frames in R column-wise. I tried full_join function of the dplyr package but the rows are repeated. In both the data frames the date column is common.

Any kind of help/suggestion will be highly appreciated.

Regards
John


#2

About join and relational data, you can take a look at R for DataScience chapter on it

Know that you have several verbs inner_join, full_join, right_join, left_join, semi_join, anti_join that depends how you want ot join your table. The book gives a nice introduction to those.

Also, if you us to help you with your example, you need to provide some data sample and code. A reproductible example would be perfect. (see reprex)


#3

Hi cderv,

Thanks for your suggestions and the book link.

I solved my problem now using cbind function.

Thanks
John


#4

Glad to here it is solved. I know you can set the question as resolved but don’t know how.
@mara could help us on that.

Know that in dplyr you have also the bind_cols function that could be useful for you.


#5

@cderv, Thanks for the suggestion. The bind_cols function does the same work for me as cbind function.

Regards
John


#6

Looks like @johnn figured it out :+1:! FFR, I explain how to mark a solution here: