rbind data.frames in a list in R
问题 Suppose we have 3 list s of data.frame s. In BASE R, I was wondering how I could automatically (ex. in a looping structure) rbind the data.frame s within these 3 lists? Please note I want the looping structure so it can rbind any more number of similar lists (ex. g4 g5 ...) g1 <- list(b1 = list(data.frame(a = 1:3, b = 3:5))) g2 <- list(b1 = list(data.frame(a = 1:3, b = 3:5))) g3 <- list(b1 = list(data.frame(a = 1:3, b = 3:5))) 回答1: Here is an option with base R do.call(rbind, lapply(mget(ls