I am new to R. I have many csv files that I want to append into a single CSV file.
I have the following issues in my below code:
- After the 3rd line Error in read.table(file = file, header = header, sep = sep, quote = quote, : argument "file" is missing, with no default **
- I don't know the number of files in the folder to rowbind. So how do I amend this line of code to rowbind an unknown number of files? bind_rows(tables [1], tables [2], tables[3])
Thank you!
library(dplyr)
files <- list.files(path = "C:/Users/...",pattern="*.csv", full.names = T)
tables <- lapply(files, read.csv(header=False))
merged <- bind_rows(tables [1], tables [2], tables[3])
write.csv(merged, file = "C:/.../files_merged.csv", row.names = FALSE)