I’ve created an R package to download air quality data from the website of the Sistema Nacional de Información de la Calidad del Aire and published it to CRAN. To install it you have to type the following:
1 | install.packages("rsinaica")
|
you can also install the development version by typing:
1 2 3 4 | if (!require(devtools)) {
install.packages("devtools")
}
devtools::install_github("diegovalle/rsinaica")
|
Website | https://hoyodesmog.diegovalle.net/rsinaica/ |
Download from CRAN | https://cran.r-project.org/package=rsinaica |
Browse source code | https://github.com/diegovalle/rsinaica |
Report bugs | https://github.com/diegovalle/rsinaica/issues |
The Instituto Nacional de Ecología y Cambio Climático (INECC) created the SINAICA website to gather the information generated by the more than a hundred air quality monitoring stations located throughout Mexico. The pollution and meteorological information is generated by the monitoring stations run by the state and local authorities, who then transmit it to SINAICA.
The rsinaica
package provides tools for downloading that information; for example, you
can easily create pollution maps:
And rank cities by how polluted they are (be sure to click the links):
Ozone
PM10
PM2.5
Guadalajara gets a special mention since they managed to take second place in all categories. Congratulations and better luck next year!
The package also has an official website with several examples: