rolf_to_openair: Converts data from rolf format to an openair compatible...

View source: R/openair.R

rolf_to_openairR Documentation

Converts data from rolf format to an openair compatible Format

Description

openair::openair provides Tools for the analysis of air pollution data. rOstluft focus lies in providing data from different sources to the user. The openair data format is described in openair::mydata. Basically it is a wide format with a field "date" as POSIXct or Date and the parameters as columns. Another convention are the fields "ws" for wind speed and "wd" for wind direction. Although usually the functions allows passing of the names from the wind fields with the arguments wd and ws. One disadvantage of the wide format is the loss of unit information. Normally all parameters are in expressed in mass terms. See openair::importKCL() and openair::importAURN(). This functions saves the parameter <> unit information in the attribute "units". unfortunately attributes tend to be lost by data wrangling functions. But an avid user might save the information.

Usage

rolf_to_openair(
  data,
  as_list = FALSE,
  interval = NULL,
  keep_ppb = FALSE,
  keep_interval = FALSE,
  ws = "WVv",
  wd = "WD"
)

Arguments

data

in rolf format

as_list

optional, if TRUE returns a list a tibble for each parameter and keeps the unit information. Handy for applying functions with purrr.

interval

optional filter for interval

keep_ppb

usually volume concentrations are not used for analyses and are dropped with the exception of NOx. When FALSE drops parameters with ppb/ppm units except NOx. Default FALSE

keep_interval

keep the "interval" column. Default FALSE

ws

renames this parameter to "ws". Default "WVv". Set ws = NULL to disable renaming

wd

renames this parameter to "wd". Default "WD". Set wd = NULL to disable renaming

Details

Some functions, for example openair::timeAverage, have the argument "type". This argument allows to specifiy columns as grouping columns. However, if type is not supplied grouping variables (character or factor) will be dropped. Most other functions need a mandatory assignment of the argument pollutant.

Value

tibble in openair compatible format

Examples

h1 <- system.file("extdata", "Zch_Stampfenbachstrasse_h1_2013_Jan.csv",
                   package = "rOstluft.data", mustWork = TRUE)

airmo_h1 <- read_airmo_csv(h1)
rolf_to_openair(airmo_h1)


Ostluft/rOstluft documentation built on Feb. 6, 2024, 1:26 a.m.