I have a large collection of csv files that are in different folders and in folders within folders that I need to merge into one file. It would be easy if they were all in o
Here is a solution with dplyr
# get list of files ending in csv in directory root
dir(root, pattern='csv$', recursive = TRUE, full.names = TRUE) %>%
# read files into data frames
lapply(FUN = read.csv) %>%
# bind all data frames into a single data frame
rbind_all %>%
# write into a single csv file
write.csv("all.csv")