Merge 5 dataframes at the same time with left join

**I want to merge the 4 tables df.geo,df.educations,df.caracteristiques,df.groupes.age with my main table df.estimation.all by left join at the same time.I want to use the merge function.

**Here,my code
df1 <- merge(df.estimations.all, df.geo, by.x="Geo_id",by.y="ID")
df2 <- merge(df1, df.caracteristiques, by.x="caracteristique_id",by.y="ID")
df3 <- merge(df2, df.education, by.x="education_id",by.y="ID")
df4 <- merge(df3, df.groupes.ages, by.x="groupe_age_id",by.y="ID")

I expect you can achieve that by combining merge() with Reduce()

do you an idea how i can write it?

Look at example 3 here:

1 Like

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.