Quantcast
Channel: Merging lists of data frames with different length - Stack Overflow
Browsing index pages (4 articles)

Merging lists of data frames with different length

I want to merge two lists of data frames. The lists have different length and the data frames in them also.ls(df_list1) [1]...

View Article


Answer by ThomasIsCoding for Merging lists of data frames with different length

I use the following dummy data frames df1 and df2 as examples to show you how to make it (if I understand your purpose correctly)df1 <- data.frame(a = 1:5, b = 6:10)df2 <- data.frame(c = 1:6, d =...

View Article


Answer by ThomasIsCoding for Merging lists of data frames with different length

I am not sure what is your desired output. With the data you provided in your post, I tried to make the minimal changes to your code to see if that is what you want:Since you attempt to save all...

View Article

Answer by hello_friend for Merging lists of data frames with different length

Base R solution: df <- data.frame(Reduce(function(x, y){ merge(x, y, by = intersect(colnames(x), colnames(y)), all = TRUE)}, c(setNames(df_list1, c(paste0("X_", names(df_list1)))),...

View Article
Browsing index pages (4 articles)


Latest Images