knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
aiR is an R package for querying and retrieving air quality information from AirNow via the AirNow API. Current and historical readings as well as forecasts can be retrieved as tidy data frames.
This package is changing rapidly, so it's not quite ready for CRAN.
To get a bug fix or to use a feature from the development version, you can install the development version of aiR from GitHub.
# install.packages("remotes") remotes::install_github("briandconnelly/aiR")
The AirNow API is generally free to use.
The use_airnow()
function can be used to help you create and configure your API token.
aiR::use_airnow()
The AirNow API allows you to query air conditions either by ZIP code or latitude/longitude. Here, we'll get the current conditions in Seattle by ZIP code:
library(aiR) get_conditions(zip = 98101)
Please note that the aiR project is released with a Contributor Code of Conduct. By contributing to 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.