R/update_data_and_predict.R
update_data_and_predict.Rd
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)
day_string | day for which to predict the water quality, in format
yyyy-mm-dd, e.g. "2019-07-01". Default: |
---|---|
upload | logical. If |
dbg | debug level. The higher the value, the more verbose the output |
The following environment variables need to be set:
URL to KWB's download FTP server
URL to Senate's download FTP server
URL to TSB's upload server
User name and password for KWB's download FTP server
User name and password for Senate's download FTP server
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.