I'm looking at air quality data and trying to create a continuous time series from weekly 5 min data that I update every week. I have been creating weekly plots, but now my PI wants to see a continuous time series and I'm not sure how to stitch the data together.
Each dataset goes from Tuesday at 6 am to the following Tuesday at 6 am for one particular monitoring site (the eventual goal being to plot multiple sites at once to check for correlation, etc).
The code that I had attempted to use (taken from the Coursera course that I was taking while on a free trial) was this, and doesn't appear to work.
polluplot <- function(directory, pollutant, id = 1:6){
files.list <- list.files(directory, full.names = TRUE)
dat <- data.frame()
for(i in id){
dat <- rbind(dat, read.csv(files.list[i]))
}
pollplots <- plot(dat[, "CO"], na.rm = TRUE)
return(pollplots)
}
This made a single data frame of 6051 rows from your three files. I had to edit the file for Dec 13-20 because it has a row under the header listing the units and that causes all of the columns to be characters. That file is also missing the first column name, Date_Time, so I inserted that.