# basic use
timeVariation(mydata, pollutant = "nox")
# for a subset of conditions
timeVariation(subset(mydata, ws > 3 & wd > 100 & wd < 270),
pollutant = "pm10", ylab = "pm10 (ug/m3)")
# multiple pollutants with concentrations normalised
timeVariation(mydata, pollutant = c("nox", "co"), normalise = TRUE)
# show BST/GMT variation (see ?cutData for more details)
# the NOx plot shows the profiles are very similar when expressed in
# local time, showing that the profile is dominated by a local source
# that varies by local time and not by GMT i.e. road vehicle emissions
timeVariation(mydata, pollutant = "nox", type = "gmtbst")
## In this case it is better to group the results for clarity:
timeVariation(mydata, pollutant = "nox", group = "gmtbst")
# By contrast, a variable such as wind speed shows a clear shift when
# expressed in local time. These two plots can help show whether the
# variation is dominated by man-made influences or natural processes
timeVariation(mydata, pollutant = "ws", group = "gmtbst")
## It is also possible to plot several variables and set type. For
## example, consider the NOx and NO2 split by levels of O3:
timeVariation(mydata, pollutant = c("nox", "no2"), type = "o3", normalise = TRUE)
## sub plots can be extracted from the openair object
results <- timeVariation(mydata, pollutant = "no2")
plot(results, subset = "day.hour") # top weekday and plot
## plot(results, subset="hour") is the diurnal plot
## plot(results, subset="day") is the weekday plot
## plot(results, subset="month") is the monthly plot
## numerical results (mean, lower/upper uncertainties)
## results$data$day.hour are the weekday and hour results
## results$data$hour are the diurnal results
## results$data$day are the weekday results
## results$data$month are the monthly results
Run the code above in your browser using DataLab