X-Git-Url: https://git.auder.net/?p=talweg.git;a=blobdiff_plain;f=pkg%2FR%2FData.R;h=4e16805fa85f2b190b767f0d44d2f2c1de4f5a88;hp=d4609f20082f0939f3cdd5128381240a6c5de683;hb=f17665c7d3da672163779da686d9f4d1ebad31f9;hpb=42916467fa0d13aba2f345682d877adc11e1a77b diff --git a/pkg/R/Data.R b/pkg/R/Data.R index d4609f2..4e16805 100644 --- a/pkg/R/Data.R +++ b/pkg/R/Data.R @@ -1,30 +1,27 @@ -#' @title Data +#' Data #' -#' @description Data encapsulation +#' Data encapsulation #' #' @field data List of #' \itemize{ #' \item time: vector of times #' \item serie: centered series #' \item level: corresponding levels +#' \item exo: exogenous variables #' \item exo_hat: predicted exogenous variables -#' \item exo_Dm1: List of measured exogenous variables at day minus 1 #' } #' -#' @exportClass Data -#' @export Data -Data = setRefClass( - Class = "Data", - - fields = list( - data = "list" - ), - - methods = list( +#' @docType class +#' @importFrom R6 R6Class +#' +#' @export +Data = R6Class("Data", + public = list( + data = "list", initialize = function(...) { "Initialize empty Data object" - +#TODO: continue from here callSuper(...) }, getSize = function() @@ -37,12 +34,7 @@ Data = setRefClass( { "'Standard' horizon, from t+1 to midnight" - L1 = length(data[[1]]$serie) - L2 = length(data[[2]]$serie) - if (L1 < L2) - L2 - L1 - else - L1 + 24 - as.POSIXlt( data[[1]]$time[1] )$hour + 1 }, append = function(new_time, new_serie, new_level, new_exo_hat, new_exo) {