The U.S. Embassy and Consulates General in India maintain an air quality monitoring program with on-site measuring instruments and put the corresponding data on this website. There are csv files for 2013 and 2014, for 2015 except December which is in a pdf, and various csv/pdf for the months of the beginning of 2016. From August 2016 I chose to use OpenAQ and in particular ropenaq to get new data.
In this repository I have made a copy of these files and provide a R code for wrangling them to get a single csv with all measures for Delhi, Mumbai, Kolkata, Hyderabad and Chennai. Refer to original source for licensing questions.
Useful even for non R users: You will find the raw data in this folder and my wrangling code is here. The resulting csv is here. I will try to update the repository as new data comes in on the embassy website.
I have made a R package out of the data so that my fellow R users can easily play with the data. The package imports ggTimeSeries
for doing the calendar plot. It can be installed this way:
devtools::install_github("Ather-Energy/ggTimeSeries") devtools::install_github("masalmon/usaqmindia")
The data is in a long format:
library("usaqmindia") library("dplyr") data("pm25_india") pm25_india %>% head(n = 20) %>% knitr::kable()
Below is an example plot of concentrations (see the code here). Check out the Diwali peaks!
library("usaqmindia") usaqmindia_plot()
And this is a calendar plot of daily median concentrations in one city using the ggTimeSeries
package (see the code here):
usaqmindia_calendar(cityplot = "Delhi")
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.