Recombining a list of Data.frames into a single data frame [duplicate]

I am sorry if this question has been answered already. Also, this is my first time on stackoverflow.

I have a beginner R question concerning lists , data frames and merge() and/or rbind().

I started with a Panel that looks like this

COUNTRY YEAR VAR
A         1
A         2
B         1
B         2

For efficiency purposes, I created a list that consists of one data frame for each country and performed a variety of calculations on each individual data.frame. However, I cannot seem to combine the individual data frames into one large frame again.

rbind() and merge() both tell me that only replacement of elements is allowed.

Could someone tell me what I am doing wrong/ and how to actually recombine the data frames?

Thank you


Maybe you want to do something like:

do.call("rbind", my.df.list)


dplyr lets you use bind_rows function for that:

library(dplyr)

foo <- list(df1 = data.frame(x=c('a', 'b', 'c'),y = c(1,2,3)), 
         df2 = data.frame(x=c('d', 'e', 'f'),y = c(4,5,6)))

bind_rows(foo)