need to import multiple CSVs file with selected columns with fread() function

I would avoid map_df (or map_dfr) for this case:

library(data.table)

df <- rbindlist(
  lapply(
    list.files(path = "/Users/admin/apps/csv-courses/", pattern = "*.csv"), 
    fread, 
    select = c("col1", "col5")
  )
)
1 Like