Atmospheric air pollution is one of the most important environmental concerns in many countries around the world, and it is strongly affected by meteorological conditions. Accordingly, in this set of exercises we use
openair package to work and analyze air quality and meteorological data. This packages provides tools to directly import data from air quality measurement network across UK, as well as tools to analyse and producing reports.
In the previous exercises set we used data from MY1 station to see how to import data and extract basic statistical information from data. Then we practiced a few basic functions that are available in
openair package. In this exercise set we will practice more advance functions that are very useful for air quality data analysis.
Answers to the exercises are available here.
For other parts of this exercise set follow the tag openair
Please load the package
openair before starting the exercises.
In the first exercise we will use
timeVariation function to see the variation of a pollutant by time of day and day of week which can reveal useful information. For example, o3 is
produced only during daytime so it is typically expected to be maximum in the afternoon and reaches its minimum during nighttime. The
timeVariation function produces four plots: day of the week variation, mean hour of day variation and a combined hour of day – day of week plot and a monthly
timeVariation function to plot timeseries for pm10 and o3 for my1data that was used in the previous exercise sets.
timeVariation function is also flexible to subset data based on the given conditions. For example one can set the conditions to consider only those hours when wind speed and direction is in a specific range.
timeVariation function to plot timeseries for pm10 and o3 for my1data. Only consider those hours when ws > 5 and wd is between 50 and 200.
It is also possible to see the time series of multiple variables using
timeVariation. For example the production of o3 is strongly depends on its precursors including, nox, no2, and co. So it would be very useful to see the variation of o3 concentration with its precursors.
timeVariation function to plot time series for o3, nox, no2, and co for my1data.
Another interesting function that is available in
scatterPlot function. The purpose of this function is to make it straightforward to consider how variables are related to one another in a way consistent with other
scatterPlot to show scatter plot of daily o3 concentration for the month of April with different levels of ambient temperature.
scatterPlot to show scatter plot of nox vs no2 concentration by the level of temperature in each season.
- Become a Top R Programmer Fast with our Individual Coaching Program
- Explore all our (>4000) R exercises
- Find an R course using our R Course Finder directory
- Subscribe to receive weekly updates and bonus sets by email
- Share with your friends and colleagues using the buttons below