Merge multiple data frames by shared columns

Dear all,

I have a multiple data frames that I want to merge based on shared columns.
I found this easy way to merge various df by shared columns based on what I want:

`Reduce(function(x,y) merge(x = x, y = y, by = c("patient_id", "exam_date", "quality_R", "quality_L"), all.x = TRUE, suffixes = "x", "y", "z"), list(nmo_rfnl, nmo_gcipl, nmo_inl, nmo_elm, nmo_bm))

but some of the basal df's shared some columns names so when I check the results I obtained a lot of duplicate in the results regardless the suffixes. I was wondering if it is possible to assign an ending for some column for example: "_rfnl", "_gcipl" for each itineration.

I was thinking of changing all the columns names previously to the merge but then a merge by common names will not be possible.

Thanks!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.