#' Data
#'
-#' Data encapsulation
+#' Data encapsulation as a list (days) of lists (components).
#'
-#' @docType class
-#' @importFrom R6 R6Class
+#' The private field .data is a list where each cell contains the variables for a period
+#' of time of 24 hours, from time P+1 until P the next day where P is an integer between
+#' 0 and 23. .data[[1]] refers to the first measured data (serie and exogenous
+#' variables): the corresponding times can be accessed through the function
+#' \code{getTime()} below. Each cell .data[[i]] is itself a list containing five slots,
+#' as described in the 'field' section.
+#'
+#' @usage data <- Data$new()
#'
-#' @field .data List of
+#' @field .data[[i]] List of
#' \itemize{
#' \item time: vector of times
-#' \item centered_serie: centered series
-#' \item level: corresponding levels
+#' \item centered_serie: centered serie
+#' \item level: corresponding level
#' \item exo: exogenous variables
-#' \item exo_hat: predicted exogenous variables
+#' \item exo_hat: predicted exogenous variables (for next day)
#' }
#'
#' @section Methods:
#' \describe{
#' \item{\code{getSize()}}{
-#' Return number of series in dataset.}
+#' Number of series in dataset.}
#' \item{\code{getStdHorizon()}}{
-#' Return number of time steps from serie[1] until midnight}
-#' \item{\code{appendHat(time, exo_hat)}}{
-#' New estimated exogenous variables + time}
-#' \item{\code{append(serie, exo)}}{
-#' New measured data; call *after* \code{appendHat()}}
+#' Number of time steps from serie[1] until midnight}
+#' \item{\code{append(time, serie, exo, exo_hat)}}{
+#' Measured data for given vector of times + exogenous predictions from
+#' last midgnight.}
#' \item{\code{getTime(index)}}{
-#' Get times at specified index.}
+#' Times (vector) at specified index.}
#' \item{\code{getCenteredSerie(index)}}{
-#' Get (measured or predicted) centered serie at specified index.}
+#' Centered serie at specified index.}
#' \item{\code{getCenteredSeries(indices)}}{
-#' Get centered series at specified indices (in columns).}
+#' Centered series at specified indices (in columns).}
#' \item{\code{getLevel(index)}}{
-#' Get level at specified index.}
+#' Level at specified index.}
#' \item{\code{getSerie(index)}}{
-#' Get serie (centered+level) at specified index.}
+#' Serie (centered+level) at specified index.}
#' \item{\code{getSeries(indices)}}{
-#' Get series at specified indices (in columns).}
+#' Series at specified indices (in columns).}
#' \item{\code{getExoHat(index)}}{
-#' Get predicted exogenous variables at specified index.}
+#' Predicted exogenous variables at specified index.}
#' \item{\code{getExo(index)}}{
-#' Get exogenous variables at specified index.}
+#' Measured exogenous variables at specified index.}
#' \item{\code{removeFirst()}}{
#' Remove first list element (if truncated).}
#' \item{\code{removeLast()}}{
#' Remove last list element (if truncated).}
#' }
#'
+#' @docType class
+#' @format R6 class
+#'
Data = R6::R6Class("Data",
private = list(
.data = list()