knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

rcaaqs

img Travis-CI Build StatusLicense

Overview

An R package to facilitate the calculation of air quality metrics according to the Canadian Ambient Air Quality Standards (CAAQS)

Features

Installation

The package is not available on CRAN, but can be installed using the devtools package:

install.packages("devtools") # if not already installed

library(devtools)
install_github("bcgov/rcaaqs")

Usage

This is a simple example using the included sample data set for PM2.5.

library(rcaaqs)
library(dplyr, warn.conflicts = FALSE)

# Look at the sample data:
glimpse(pm25_sample_data)

# Compute the PM2.5 Annual CAAQS
pm_annual <- pm_annual_caaqs(pm25_sample_data, by = c("ems_id", "site"))
glimpse(pm_annual)

# Compute the PM2.5 24hr CAAQS
pm_24h <- pm_24h_caaqs(pm25_sample_data, by = c("ems_id", "site"))
glimpse(pm_24h)

This is a simple example using the included sample data set for O3.

# Look at the sample data:
glimpse(o3_sample_data)

# Compute the Ozone CAAQS
o3 <- o3_caaqs(o3_sample_data, by = c("ems_id", "site"))
glimpse(o3)

This is a simple example using the included sample data set for SO2.

# Look at the sample data:
glimpse(so2_sample_data)

# Compute the SO2 1-hr CAAQS (3-yr rolling average of 1hr measures)
so2_3yr <- so2_3yr_caaqs(so2_sample_data, by = c("ems_id", "site"))
glimpse(so2_3yr)

# Compute the SO2 annual CAAQS (1-yr average across all hourly measures)
so2_1yr <- so2_1yr_caaqs(so2_sample_data, by = c("ems_id", "site"))
glimpse(so2_1yr)

This is a simple example using the included sample data set for NO2.

# Look at the sample data:
glimpse(no2_sample_data)

# Compute the NO2 1-hr CAAQS (3-yr rolling average of 1hr measures)
no2_3yr <- no2_3yr_caaqs(no2_sample_data, by = c("ems_id", "site"))
glimpse(no2_3yr)

# Compute the NO2 annual CAAQS (1-yr average across all hourly measures)
no2_1yr <- no2_1yr_caaqs(no2_sample_data, by = c("ems_id", "site"))
glimpse(no2_1yr)

You can view the CAAQS Achievement Levels as well as Management Levels in the included data frames. These are used internally in rcaaqs CAAQS functions to assign metric values at each station to the appropriate CAAQS Achievement Level and Management Level:

achievement_levels

management_levels

Project Status

The package is under active development.

Getting Help or Reporting an Issue

To report bugs/issues/feature requests, please file an issue.

How to Contribute

If you would like to contribute to the package, please see our CONTRIBUTING guidelines.

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.

License

Copyright 2015 Province of British Columbia

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

This repository is maintained by Environmental Reporting BC. Click here for a complete list of our repositories on GitHub.



bcgov/rcaaqs documentation built on Dec. 12, 2023, 9:21 a.m.