0

I have some data frame data1, data2, data10. I want to combine all those data frames by rows.

I tried using rbind in a loop but i can't call dataframe correctly in the loop.

tempo<-data.frame()

for(j in 1:10){

  tempo<-rbind(tempo,eval(parse(paste0("data",j))))

}

but that doesn't work. R doesn't know the dataframe that i want to call with command eval(parse)

Thank you

DD chen
  • 169
  • 11
  • 5
    `do.call(rbind, mget(paste0("data", 1:10)))` ? – Ronak Shah May 29 '19 at 08:42
  • 2
    You should avoid having lots of `data.frames` in your `env`, read Gregor's answer here: https://stackoverflow.com/questions/17499013/how-do-i-make-a-list-of-data-frames – RLave May 29 '19 at 08:47

0 Answers0