FrameData: FrameData

Description Fields Methods See Also Examples

Description

An abstract class for storing data in the form of a data frame. It enforces core functionality that we want the data we model to have. This class covers any data which is stored as list.

Fields

arr

This is the full array. For extensibility, it cannot be written to directly and must be modified through methods.

cellData

A list of metadata associated with the cells of the data.

cnames

The names of columns in the data.

colData

A list of metadata associated with the columns of the data.

dimData

The data associated with each dimension of the array.

dims

The size of the array.

dnames

The size of the array.

frame

The data frame this class is responsible for.

mat

This is the matrix. For extensibility, it cannot be written to directly and must be modified through methods.

metaData

Any data not part of the main data structure.

ncol

The number of columns in the data.

ndim

The number of dimensions of the array.

nrow

The number of rows in the data

rnames

The names of rows in the data.

rowData

A list of metadata associated with the rows of the data.

Methods

debug(string)

A function for debugging the methods of this class. It calls the browser command. In order for methods to opt into to debugging, they need to implement the following code at the beginning: if(<method_name> %in% private$.debug){browser()}. This method exists, because the debugger is not always intuitive when it comes to debugging R6 methods.

Arguments
string - The name(s) of methods to debug as a character vector

initialize(...)

This function should be extended. Create a new instance of this class.

Arguments
... - This function should take in any arguments just in case.

undebug(string)

A function for ceasing to debug methods. Normally a method will call the browser command every time it is run. This command will stop it from doing so.

Arguments
string - The name(s) of the methods to stop debugging.

See Also

Inherits from : ArrayData

Is inherited by : AbstractObservationList, RelationalData

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
SampleFrameData <- R6Class(
  inherit = FrameData,
  public = list(
    initialize = function(data){
      private$.frame = data
      private$.arr = data
      private$.mat = data
      private$.dims = dim(data)
      private$.ndim = length(private$.dims)
      private$.dnames = dimnames(data)
    }
  )
)

HopkinsIDD/ForecastFramework documentation built on Nov. 10, 2019, 2:15 a.m.