7 #' \item time: vector of times
8 #' \item serie: centered series
9 #' \item level: corresponding levels
10 #' \item exo: exogenous variables
11 #' \item exo_hat: predicted exogenous variables
15 #' @importFrom R6 R6Class
18 Data = R6Class("Data",
21 initialize = function(...)
23 "Initialize empty Data object"
24 #TODO: continue from here
29 "Number of series in the dataset"
33 getStdHorizon = function()
35 "'Standard' horizon, from t+1 to midnight"
37 24 - as.POSIXlt( data[[1]]$time[1] )$hour + 1
39 append = function(new_time, new_serie, new_level, new_exo_hat, new_exo)
41 "Acquire a new vector of lists (time, serie, level, exo_hat, exo)"
43 data[[length(data)+1]] <<- list("time"=new_time,"serie"=new_serie,"level"=new_level,
44 "exo_hat"=new_exo_hat,"exo"=new_exo)
46 getTime = function(index)
48 "Time values at specified index"
50 index = dateIndexToInteger(index, .self)
53 getCenteredSerie = function(index)
55 "Serie values (centered) at specified index"
57 index = dateIndexToInteger(index, .self)
60 getLevel = function(index)
62 "Level of the serie at specified index"
64 index = dateIndexToInteger(index, .self)
67 getSerie = function(index)
69 "Serie values (centered+level) at specified index"
71 index = dateIndexToInteger(index, .self)
72 data[[index]]$serie + data[[index]]$level
74 getExoHat = function(index)
76 "Exogeous predictions at specified index"
78 index = dateIndexToInteger(index, .self)
81 getExo = function(index)
83 "Exogenous measures at specified index"
85 index = dateIndexToInteger(index, .self)