0

I have a bunch of df saves as 1.csv, 2.csv, 3.csv, 4.csv, 5.csv, ... 10.csv) Whats an efficient way to bind say for example the first 5 into one df such as one_five <- (include 1-5.csv)

I want to know another way than rbind as I got about 400 different dfs.

Thanks

  • `do.call(rbind,lapply(list.files(pattern='.csv'),function(x) read.csv(x)))` – Duck Oct 27 '20 at 20:32
  • No anonymous function needed! `do.call(rbind,lapply(list.files(pattern='.csv'), read.csv))` – Gregor Thomas Oct 27 '20 at 20:36
  • This will bind all the df into one. I got 400 df and I want a multiple of 20 into one df, making 20 different df. I will need a way where I can specify for example from 1-20.csv into one df and so on. – CamCaan Oct 27 '20 at 20:45

0 Answers0