Description Usage Arguments Details Value Colors References See Also Examples
The function returns the respective hourly CAQI grading, as defined by the Common Information to European Air (CITEAIR and CITEAIR II) projects[1].
1 |
x |
A numeric vector of particulate matter measurements (µg/m³). |
norm |
One value of either "PM10" or "PM2.5",
setting the PM size of the given values of |
raw |
Logical, if true returns only the CAQI raw values. |
latex_cellcolors |
Logical,
if true the "CAQI_color_*" columns will show LaTeX |
The index has five levels, named "very low" (best air quality), "low", "medium", "high", and "very high" (worst air quality). Thresholds are different between PM10 and PM2.5 particles.
If raw=TRUE
, a numeric vector with the raw CAQI values. Otherwise a data frame with
four columns: raw input data, CAQI value, CAQI level (factor),
recommended color code (factor).
The column names start with "raw_", "CAQI_", "CAQI_level_", and "CAQI_color_",
and end with either "PM10" or
"PM2_5", depending on the value of norm
.
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 provide a <span>
with 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 | header-includes:
- \definecolor{CAQIvh}{HTML}{960018}
- \definecolor{CAQIh}{HTML}{F29305}
- \definecolor{CAQIm}{HTML}{EEC20B}
- \definecolor{CAQIl}{HTML}{BBCF4C}
- \definecolor{CAQIvl}{HTML}{79BC6A}
|
[1] https://www.airqualitynow.eu/about_indices_definition.php
1 | CAQI_PM(55)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.