I have a list of dataframes which I eventually want to merge while maintaining a record of their original dataframe name or list index. This will allow me to subset etc acro
dlply function form plyr package could be an answer:
library('plyr') df1 <- data.frame(x=c(1:5),y=c(11:15)) df2 <- data.frame(x=c(1:5),y=c(11:15)) mylist <- list(df1 = df1, df2 = df2) all <- ldply(mylist)