predict_quality: Predict Water Quality for Bathing Spot Using Stored Model

Description Usage Arguments Value

View source: R/predict_quality.R

Description

If no time period is specified, the function will first check the measurements for missing E.coli values and do the prediction for the days for which an E.coli value of -1 has been uploaded. If all E.coli measurements are valid, the prediction will be done for the current day (Sys.Date()).

Usage

1
2
3
4
5
6
7
8
9
predict_quality(
  user_id,
  spot_id,
  from = Sys.Date(),
  to = from,
  import = TRUE,
  return_debug_info = FALSE,
  radolan_time = NULL
)

Arguments

user_id

user ID

spot_id

bathing spot ID

from

Date object or date string in format yyyy-mm-dd giving the first day of the time period to be predicted. Default: "today"

to

Date object or date string in format yyyy-mm-dd giving the last day of the time period to be predicted. Default: "today"

import

logical telling whether to import new rain data or not. Default: TRUE.

return_debug_info

logical with default FALSE. If TRUE the prediction is not written to the database. Instead, what would be send to the database is returned with all relevant variables that were used to prepare the prediction being set as attributes.

radolan_time

time string ("hhmm") against which to match the RADOLAN file names to be loaded. By default, the latest available time for the day given in from is used (for all days within from and to).

Value

list with elements data, success, message or (if return_debug_info = TRUE) data frame representing the predictions with attributes spot_data, riverdata_raw, riverdata, newdata_raw, newdata, prediction representing intermediate variables that were used to prepare the prediction (see source code of fhpredict::predict_quality to understand their meaning)


KWB-R/fhpredict documentation built on Nov. 1, 2020, 5:58 a.m.