update_data_and_predict: Update Model Input Data and Predict Water Quality

Description Usage Arguments Details

View source: R/update_data_and_predict.R

Description

This is the main function. It is assumed to be run on a daily basis. It downloads current rain and flow data, does a simple validation of the data, prepares the data for the model and runs the model to predict the water quality.

Usage

1
2
3
4
5
update_data_and_predict(
  day_string = as.character(Sys.Date()),
  upload = FALSE,
  dbg = 1
)

Arguments

day_string

day for which to predict the water quality, in format yyyy-mm-dd, e.g. "2019-07-01". Default: as.character(Sys.Date())

upload

logical. If TRUE the prediction file Vorhersage_yyyy-mm-dd.csv is uploaded to the server of Technologiestiftung Berlin (TSB).

dbg

debug level. The higher the value, the more verbose the output

Details

The following environment variables need to be set:

FTP_URL_KWB

URL to KWB's download FTP server

FTP_URL_SENATE

URL to Senate's download FTP server

FTP_URL_TSB

URL to TSB's upload server

USER_PWD_KWB

User name and password for KWB's download FTP server

USER_PWD_SENATE

User name and password for Senate's download FTP server

USER_PWD_TSB

User name and password for TSB's upload server

You may use usethis::edit_r_environ() to open the .Renviron file in which you can add the corresponding assignments.


KWB-R/kwb.flusshygiene.app documentation built on July 18, 2021, 2:55 p.m.