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.

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.