0

I want to open 27 files from the folder and create 27 particular data frames. I'm stuck on the stage of creating dfs. Before that I've done

setwd("//folder")
filenames <- list.files(pattern = ".xlsx")

Now I do not know what to do. I can open them in one big df, but I don't need it actually.

How do I open all 27 .xlsx in 27 particular data frames?

k1rgas
  • 399
  • 2
  • 10
  • `lapply(filenames, readxl::read_excel)` gives you a list of frames. Since it's likely (I'm assuming) that they are all somewhat similar, it is generally recommended to work on a list-of-frames, since what you do to one frame is likely to be done to all. See https://stackoverflow.com/a/24376207/3358272. (The anti-pattern to that recommendation is full of multiple calls to `get` or `mget` and `assign`, a methodology that generally leads to a workflow operating in side-effect, often rendering it unreproducible and harder to troubleshoot.) – r2evans Jun 25 '20 at 19:00

0 Answers0