Using this option it is possible to read all csv of a specific path into one dataframe library(dplyr) library(stringr)
library(data.table)
setwd("C:/Users/User/Desktop/myfile")
files <- list.files(path = "C:/Users/User/Desktop/myfile",pattern = ".csv")
temp <- lapply(files, fread, sep=",")
data <- rbindlist( temp )
What command could be the most appropriate in order to add a column which will have the file name for every row?