-
Notifications
You must be signed in to change notification settings - Fork 5
/
README.Rmd
151 lines (105 loc) · 4.76 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
---
output: github_document
html_preview: true
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# rcaaqs
[![img](https://img.shields.io/badge/Lifecycle-Maturing-007EC6)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)
[![Travis-CI Build Status](https://travis-ci.org/bcgov/rcaaqs.svg?branch=master)](https://travis-ci.org/bcgov/rcaaqs)[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
## Overview
An [R](https://www.r-project.org/) package to facilitate the calculation of air quality
metrics according to the Canadian Ambient Air Quality Standards
([CAAQS](http://www.ccme.ca/en/current_priorities/air/caaqs.html))
## Features
- General functions for doing things like formatting dates, filling in
sequences, etc.
- Functions for stepwise calculation of CAAQS metrics—including implementing data completeness criteria—for
different air pollutants. Currently these are complete for PM~2.5~
(annual and 24hr), O~3~, NO~2~, and SO~2~ metrics.
- Functions for assigning
metrics for different pollutants into achievement and management categories.
## Installation
The package is not available on CRAN, but can be installed using
the [devtools](https://github.com/hadley/devtools) package:
```{r, eval=FALSE}
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 PM<sub>2.5</sub>.
```{r}
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 O<sub>3</sub>.
```{r}
# 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 SO<sub>2</sub>.
```{r}
# 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 NO<sub>2</sub>.
```{r}
# 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:
```{r}
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](https://github.com/bcgov/rcaaqs/issues/).
## How to Contribute
If you would like to contribute to the package, please see our
[CONTRIBUTING](CONTRIBUTING.md) guidelines.
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). 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](http://www2.gov.bc.ca/gov/content?id=FF80E0B985F245CEA62808414D78C41B). Click [here](https://github.com/bcgov/EnvReportBC) for a complete list of our repositories on GitHub.