The overall goal is to create a continuous data set from weekly data. I have used the following code and it recognizes that there are 14 files in the directory, but only reads 9 into a data frame. I know that the limit for data frames is much higher than what I have, so I don't understand why it would stop adding to the data frame at that point.
I do not see a problem with your code. If I compare the number of rows in AllDat to the rows in the individual files, they match. How are you detecting that data are missing?
library(purrr)
FILES <- list.files("~/R/Play/FILES/WBEA-Raw",pattern = "csv$",full.names = TRUE)
AllDat <- map_dfr(FILES, read.csv)
#sum the number of rows in the files
tmp2 <- 0
for (Nm in FILES) {
tmp <- read.csv(Nm)
tmp2 <- tmp2 + nrow(tmp)
}
#compare the rows in AllDat to tmp2
nrow(AllDat)
#> [1] 34249
tmp2
#> [1] 34249
I'm looking at the tail of AllDat - if all of the files were showing up, the end of the data should be January 31 instead of December 13. The files are in numerical order in my directory (ie 1-14) so I don't see why it should be placing January data in the middle and December at the end.
The files are read in alphabetical order, so they are ordered as 1, 10, 11, 12, 13, 14, 2, 3, etc. You can sort the rows by Date_Time after you read in the data and convert Date_Time to a numeric value.