If in this code I merge 2 data frames by ID,
full <- merge(data frameA,data frameB,by="ID")
How can I merge 4 data frames by the same ID avoiding using this code several times?
Thanks
Try this:
lst <- list(dfB, dfC, dfD)
result <- dfA
for (df in lst) result <- merge(result,df,by="ID")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With