| Type: | Package |
| Title: | Air Quality Indexing and Statistical Reporting |
| Version: | 0.1.0 |
| Description: | Provides a comprehensive framework for Air Quality Index (AQI) analysis from air pollutant concentration data using Central Pollution Control Board (CPCB) criteria. Calculates pollutant-specific AQI sub-indices and derives the overall AQI and its category, identifies the primary pollutant, and summarises, ranks, and visualizes results across monitoring locations. Methodology follows Central Pollution Control Board (2014,"National Air Quality Index") https://app.cpcbccr.com/ccr_docs/FINAL-REPORT_AQI_.pdf. |
| License: | GPL-3 |
| Encoding: | UTF-8 |
| Imports: | ggplot2, lubridate, stats, utils |
| Suggests: | plotly, readxl |
| Depends: | R (≥ 4.1.0) |
| Config/roxygen2/version: | 8.1.0 |
| NeedsCompilation: | no |
| Packaged: | 2026-08-26 12:54:54 UTC; JARVIS |
| Author: | S. Hariharan [aut, cre], V. Ra. Charumathi [aut], S. Vishnu Shankar [aut] |
| Maintainer: | S. Hariharan <Hari1971haran@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-09-08 13:40:35 UTC |
Air Quality Indexing and Statistical Reporting
Description
Provides a comprehensive framework for Air Quality Index (AQI) analysis from air pollutant concentration data using Central Pollution Control Board (CPCB) criteria. Calculates pollutant-specific AQI sub-indices and derives the overall AQI and its category, identifies the primary pollutant, and summarises, ranks, and visualizes results across monitoring locations.
Usage
AQIR(data, verbose = TRUE)
Arguments
data |
A data frame or tibble, or a file path ( |
verbose |
Logical. If |
Details
The function accepts a data frame/tibble or a CSV/Excel file path, validates and cleans the input (parsing dates, coercing pollutant values to numeric, and removing rows with missing, negative, or unparseable readings), computes pollutant-specific AQI sub-indices using standard CPCB breakpoint tables, determines the overall AQI as the maximum sub-index among the available pollutants, identifies the dominant (primary) pollutant, classifies air quality into standard AQI categories, summarizes AQI by month and location, ranks monitoring locations by average AQI, and produces graphical visualizations of the results.
Value
An invisible list containing:
-
data: The cleaned data with pollutant sub-indices, overall AQI, AQI category, and primary pollutant for each record. -
city_summary: Average AQI, record count, and overall AQI category for each location. -
ranking: Locations ranked by average AQI. -
rows_dropped: Number of rows removed during data cleaning. -
plots: A list of ggplot2 plots (trend,avg_by_location,category_dist,heatmap,monthly,boxplot,ranking), plusbest_gaugeandworst_gauge– plotly gauge charts for the best- and worst-performing locations, produced only whenverbose = TRUEand the plotly package is installed.
References
Central Pollution Control Board (2014). "National Air Quality Index". https://app.cpcbccr.com/ccr_docs/FINAL-REPORT_AQI_.pdf
Examples
# A small example dataset
air_data <- data.frame(
City = c("Chennai", "Coimbatore", "Madurai"),
Datetime = c("2025-01-01", "2025-01-02", "2025-01-03"),
PM25 = c(35, 28, 65),
PM10 = c(70, 55, 120),
NO2 = c(22, 18, 45),
SO2 = c(10, 8, 20),
CO = c(0.8, 0.6, 2.5),
NH3 = c(120, 110, 180)
)
result <- AQIR(air_data, verbose = FALSE)