Converts data from openair format to rolf
Arguments
- data
in openair format
- site
specify site of the data. Necessary if data contains no column "site"
- interval
specify interval of the data. Necessary if data contains no column "interval"
- units
specify parameter unit mapping as named vector. Name = parameter, value = unit. Necessary if data contains no column "unit"
- ws
renames parameter "ws" to this Value. Default "WVv". Set ws = NULL to disable renaming
- wd
renames parameter "wd" to this Value. Default "WD". Set wd = NULL to disable renaming
Examples
h1 <- system.file("extdata", "Zch_Stampfenbachstrasse_h1_2013_Jan.csv",
package = "rOstluft.data", mustWork = TRUE)
airmo_h1 <- read_airmo_csv(h1)
airmo_h1
#> # A tibble: 14,116 × 6
#> starttime site parameter interval unit value
#> <dttm> <fct> <fct> <fct> <fct> <dbl>
#> 1 2013-01-01 00:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.805
#> 2 2013-01-01 01:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.833
#> 3 2013-01-01 02:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.874
#> 4 2013-01-01 03:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.755
#> 5 2013-01-01 04:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.767
#> 6 2013-01-01 05:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.566
#> 7 2013-01-01 06:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.509
#> 8 2013-01-01 07:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.460
#> 9 2013-01-01 08:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.334
#> 10 2013-01-01 09:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.285
#> # ℹ 14,106 more rows
oa_h1 <- rolf_to_openair(airmo_h1)
units_h1 <- attr(oa_h1, "units")
# we lost the parameter with ppb/ppm units trough the convertions
openair_to_rolf(oa_h1, interval = "h1", units = units_h1)
#> # A tibble: 10,416 × 6
#> starttime site parameter interval unit value
#> <dttm> <fct> <fct> <fct> <fct> <dbl>
#> 1 2013-01-01 00:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.805
#> 2 2013-01-01 01:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.833
#> 3 2013-01-01 02:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.874
#> 4 2013-01-01 03:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.755
#> 5 2013-01-01 04:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.767
#> 6 2013-01-01 05:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.566
#> 7 2013-01-01 06:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.509
#> 8 2013-01-01 07:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.460
#> 9 2013-01-01 08:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.334
#> 10 2013-01-01 09:00:00 Zch_Stampfenbachstrasse CO h1 mg/m3 0.285
#> # ℹ 10,406 more rows