Home > Net >  Combine dataframe from two list to a single list
Combine dataframe from two list to a single list

Time:09-02

I have two lists containing multiple dataframes listA and listB. The first list has 5 dataframe, and the second list has 3 dataframe. I want to form a third list listC where it contains the dataframes from both list such that I will have 8 dataframes in total in listC. I tried using merge(), but it didn't seem to work.

CodePudding user response:

The function to use is append():

df <- data.frame(v1 = c(1,2))

l1 <- list(df, df, df, df)
l2 <- list(df, df)
l3 <- append(l1, l2)
  • Related