Install R package

remotes::install_github("kwb-r/kwb.pilot", upgrade = "always")

Define paths

Option 1: At KWB

In paths_list you need to replace the dummy value kwb-server for the key servername.


#KWB server
paths_list <- list(
  servername = "kwb-server",
  root = "//<servername>/projekte$/WWT_Department/Projects/SULEMAN/Exchange/",
  rawdata = "<root>/10_rawdata",
  online =  "<rawdata>/online_data",
  export_dir = "//<servername>/processing/suleman"
  )

paths <- kwb.utils::resolve(paths_list)

Option 2: At Home

paths_list <- list(
  root = "C:/kwb/projects/suleman",
  rawdata = "<root>/10_rawdata",
  online =  "<rawdata>/online_data",
  export_dir = "<root>/export"
)

# Only execute "At Home" if not at "KWB" (i.e. KWB server path does not exist) 
if(!fs::dir_exists(paths$online)) {
paths <- kwb.utils::resolve(paths_list)
}

Import

### Recursive listing of all ".xlsx" Weintek files in rawdata directory:
files <- fs::dir_ls(paths$online,recurse = TRUE, regexp = "^[^~].*\\.xlsx$")

weintek_data_raw <- kwb.pilot::read_weintek_batch(files)

Aggregate

weintek_data_10min <- weintek_data_raw %>% kwb.pilot::group_datetime(by = 600)
weintek_data_1hour <- weintek_data_raw %>% kwb.pilot::group_datetime(by = 3600)

Export

CSV files

kwb.pilot::export_data(weintek_data_raw, export_dir = paths$export_dir)
kwb.pilot::export_data(weintek_data_10min, export_dir = paths$export_dir)
kwb.pilot::export_data(weintek_data_1hour, export_dir = paths$export_dir)

Interactive HTML plots

kwb.pilot::plot_data(weintek_data_1hour, export_dir = paths$export_dir)
kwb.pilot::plot_data(weintek_data_10min, export_dir = paths$export_dir)
#kwb.pilot::plot_data(weintek_data_raw, export_dir = paths$export_dir)

```