Combining Lists of Multiple Dataframes in R -


for simplicity, have made following code.

 df1 <- data.frame(a=c(1:3), b=c('a', 'a', 'a', 'b', 'b', 'b'))  df2 <- data.frame(c=c('d'), d=c(4, 4, 5, 5, 6, 6))  1 <- split(df1, df1$b)  2 <- split(df2, df2$d)  goal_df <- data.frame(a=c(1:3), b=c('a', 'a', 'a', 'b', 'b', 'b'),                   c=c('d'), d=c(4, 4, 5, 5, 6, 6)) 

i have 2 lists 'one' , 'two'. lists contain several thousand data frames. want combine of these 1 data frame. tried rbind, ran issues because dimensions of data frames in list vary. end result should have called goal_df

we can use

library(rowr) do.call(cbind.fill, c(list(do.call(rbind, one), do.call(rbind, two)), fill = na)) 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -