<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/working-with-air-quality-and-meteorological-data-exercises-part-4/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://www.r-exercises.com/2017/09/26/working-with-air-quality-and-meteorological-data-exercises-part-4/"> R-exercises</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><a rel="nofollow" href="https://i0.wp.com/www.r-exercises.com/wp-content/uploads/2017/09/3.png" target="_blank"><img sizes="(max-width: 150px) 100vw, 150px" src="https://i0.wp.com/www.r-exercises.com/wp-content/uploads/2017/09/3-150x150.png?resize=150%2C150" alt="" class="wp-image-8067" data-recalc-dims="1"></a>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 <code>openair</code> 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. </p>
<p>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 using functions that are available in <code>openair</code> package to analyze and visualize data. In this exercise set we will go through more advance functions that are very useful in air quality data analysis. </p>
<p>Back trajectories are very useful in air pollution analysis and can provide important information on air mass origins. Back-trajectories show the path of air masses traveled over specific time periods and can be used to identify sources of pollutants. However, calculating and analysis of back-trajectory data is a time consuming process. Therefore, to overcome some of these issues and expand the possibilities for data analysis, <code>openair</code> makes several functions available to access and analyse pre-calculated back trajectories. In this exercise set will go through these functions. </p>
<p>Answers to the exercises are available <a rel="nofollow" href="http://r-exercises.com/2017/09/26/working-with-air-quality-and-meteorological-data-exercises-part-4-solutions/" target="_blank">here</a>.</p>
<p>For other parts of this exercise set follow the tag <a rel="nofollow" href="http://r-exercises.com/tag/openair" target="_blank">openair</a></p>
<p>Please load the package <code>openair</code> before starting the exercises.</p>
<p><strong>Exercise 1</strong><br>
In the first exercise we will use <code>importTraj</code> function to import precalculated back-trjactories which will be also used in the next exercises. Use <code>importTraj</code> to import pre-calculated back-trajectories for London and for the year 2011. Save the results in a dataframe named “traj”.</p>
<p><strong>Exercise 2</strong><br>
In this exercise will use <code>trajPlot</code> function to plot trajectory line to visually see how air-masses has travels before arriving to the receptor point.</p>
<p>Use <code>trajPlot</code> function to plot trajectory lines for the traj dataframe obtained in the previous exercise. Here, only use trajectories for the period of 10-16 January.</p>
<p><strong>Exercise 3</strong><br>
There are also a few other ways of representing the data shown in For example we can plot the trajectories for each day. </p>
<p>Use <code>trajPlot</code> function to plot the same trajectory lines as in the previous exercise but separate the trajectories by day. </p>
<p><strong>Exercise 4</strong><br>
One of the most useful approaches is to link the back trajectories with the concentrations of a pollutant. </p>
<p>In this exercise first import data for North Kensington using <code>importAURN</code> function. And then use <code>merge</code> function to merge the pollutant data with back-trajectories into single dataframe. </p>
<p>Now, use <code>trajPlot</code> function to plot trajectories along with pm10 level asscociated with each trajectories. </p>
<div>
<aside><img src="http://www.r-exercises.com/2017/09/26/working-with-air-quality-and-meteorological-data-exercises-part-4/"></aside>
<div>You can use Air Quality Data and weather patterns in combination with spatial data visualization, <strong>Learn more</strong> about spatial data in the online course <a rel="nofollow" href="http://www.r-exercises.com/product/intermediate-spatial-data-analysis-with-r-qgis-more/" target="_blank"><br>
[Intermediate] Spatial Data Analysis with R, QGIS &amp; More</a>. this course you will learn how to:
<ul>
<li>Work with Spatial data and maps</li>
<li>Learn about different tools to develop spatial data next to R</li>
<li>And much more</li>
</ul>
</div>
</div>
<p><strong>Exercise 5</strong><br>
Another useful analysis is to identify the contribution of high concentration back trajectories. In other words, to identify the potential of sources contributing to high pollutant concentration in the<br>
area of interest. This can be done by <code>trajrajLevel</code>. In this function we can use a number of statistics option such as frequency and difference. However another statistical method that can be applied is potential source contribution function (PSCF) method which is widely use in air mass trajectory analysis to identify potential sources or hotspots for pollution.</p>
<p>Use <code>trajrajLevel</code> function to plot and identify potential sources for high pm2.5 concentration in London in 2011.</p>
<div>
<h3>Related exercise sets:</h3>
<ol>
<li><a rel="nofollow" href="http://www.r-exercises.com/2017/09/12/working-with-air-quality-and-meteorological-data-exercises-part-3/" title="Working with air quality and meteorological data Exercises (Part-3)" target="_blank">Working with air quality and meteorological data Exercises (Part-3) </a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/2017/08/29/working-with-air-quality-and-meteorological-data-exercises-part-2/" title="Working with air quality and meteorological data Exercises (Part-2)" target="_blank">Working with air quality and meteorological data Exercises (Part-2) </a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/2017/08/15/working-with-air-quality-and-meteorological-data-exercises-part-1/" title="Working with air quality and meteorological data Exercises (Part-1)" target="_blank">Working with air quality and meteorological data Exercises (Part-1) </a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/start-here-to-learn-r/" target="_blank">Explore all our (>1000) R exercises</a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/r-courses/" target="_blank">Find an R course using our R Course Finder</a> directory</li>
</ol>
</div>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://www.r-exercises.com/2017/09/26/working-with-air-quality-and-meteorological-data-exercises-part-4/"> R-exercises</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/rXtZGkGWMYc" height="1"></a></div>