aq_hourly-methods: Get hourly means and air quality indices

Description Usage Arguments Value Colors

Description

The hour value is to be interpreted as the starting point of measurement until the next full hour. this means, if you are looking for the past hour, you need to add 1 to the hour values.

Usage

1
2
3
4
5
aq_hourly(x, time = c(), ...)

## S4 method for signature 'airData'
aq_hourly(x, time = c(), calc = c("CAQI", "EAQI"),
      latex_cellcolors = TRUE)

Arguments

x

An object of class airData.

time

An optional vector with two elements, start and end time, either in character format supported by as.POSIXct, or in POSIXct format.

calc

Character vector of air quality indices to calculate. Currently, "CAQI" and "EAQI" are supported.

latex_cellcolors

Logical, if true the "*_color_*" columns will show LaTeX \cellcolor code instead of HTML colors. See Colors section.

Value

A data frame as returned by layout_df, but reduced to hourly means.

Colors

The data frame contains rows to support coloring tables or plots, e.g. if you use the data in an RMarkdown document. If latex_cellcolors=FALSE, they simply provide hexadecimal HTML color codes for each index value. Otherwise, the factor labels are in LaTeX format using the \cellcolor command. This is useful, e.g., if combined with the kableExtra::kable function. To use the code out of the box, define the following colors in your preamble (example shows usage in a YAML header):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
header-includes:
   - \definecolor{CAQIvh}{HTML}{960018}
   - \definecolor{CAQIh}{HTML}{F29305}
   - \definecolor{CAQIm}{HTML}{EEC20B}
   - \definecolor{CAQIl}{HTML}{BBCF4C}
   - \definecolor{CAQIvl}{HTML}{79BC6A}
   - \definecolor{EAQIep}{HTML}{7D2181}
   - \definecolor{EAQIvp}{HTML}{960032}
   - \definecolor{EAQIp}{HTML}{FF5050}
   - \definecolor{EAQIm}{HTML}{F0E641}
   - \definecolor{EAQIf}{HTML}{50CCAA}
   - \definecolor{EAQIg}{HTML}{50F0E6}

unDocUMeantIt/paRticulates documentation built on Jan. 20, 2020, 5:15 p.m.