Modify test data
Remove whitespace in script
Initialize the output CSV file for writing
Init data frame for daily 8hr rolling averages for O3
Begin loop for all stations in each file
Initialize data frame for O3 daily 8-hr rolling averages
Create sub-loop for beginning of year (day 0)
Begin loop for hours of year
Get year of 8-hour averaging period
Get day of year for 8-hour averaging period
Get hour of day for 8-hour averaging period
Get date for 8-hour averaging period
Count no of rows in dataset for each 8-hour period
Count NA values in dataset for each 8-hour period
Count valid observations in each 8-hour period
Get average O3 concentration for each 8-hour period
Init data frame for daily observations
Begin loop through all days of year for station data
Get the year value
Get the ‘day of year’ value