how to use loop to subset 1000 csv files and do co-integration test in R?
I’ve got a two step solution for you: x <- list.files(path = “your directory”, pattern = “.csv”) y <- lapply(x,fread) data <- rbindlist(y) Reads in all the csvs in your directory as data tables then binds then together. After that i’d just subset as follows: data <- data[Date >= “your dates”,] EDIT* I get the … Read more