When I run this code I get an error and I'm unsure what it means and what I am doing wrong.
filenames <- list.files(path = "C:/_path_to_files_folder", full.names=TRUE, recursive = TRUE, pattern='.csv')
cars <- NULL
for(i in seq_along(filenames)) {date[[i]] <- str_extract(filenames[[i]], "20[0-9][0-9]-[0-9][0-9]")
data <- read_csv(filenames[[i]], skip = 13, col_types = cols(.default = "c"))
data <- mutate(data, Month = date[[i]])
cars <- bind_rows(cars, data)}
Error in date[[i]] <- str_extract(filenames[[i]], "20[0-9][0-9]-[0-9][0-9]") : object of type 'closure' is not subsettable