Creating one df from 85 df present in a list

hi, I am trying to fuse by columns several dataframes with different numbers of rows, each dataframe corresponding to samples taken at a certain date, not necesarilly similar dates between dataframes. All df that I need to join are included in a list; when using the code below (to join 2 df by 'toma_de_muestras') .....

I get the expected output.......

However, when I try to fuse 3 dataframes from the list, the merge() , that I am using, is not working..and I get this error message.....


I have 85 dataframes in a list to join according to this condition(by = 'toma_de_muestras')....could you please let me know how to get all 85 df merged ?, how the code should look like ? ,,,,, thanks

Use merge with Reduce. Or, if you a tidyverse person, purrr::reduce.

If you need more help, please provide a reproducible example.


Edit (in response to @aureta's next post #3)

It's difficult to say without having anything, as I cannot test. It'll be somewhat of this form:

merge_function_for_two_df <- function(df1, df2) merge(df1, df2, by="common column name", all=TRUE)
Reduce(merge_function_for_two_df, list_containing_the_dfs)

Hi Yarnabrina, thanks for your help..how the code would look like...sorry, I am a bit new in R....thanks

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