ArrayData: ArrayData

Description Fields Methods See Also Examples

Description

An abstract class for storing data in the form of an n- dimensional array. It enforces core functionality that we want the data we model to have. This class covers any data which has two major axis, but has more minor axis.

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.

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 : MatrixData

Is inherited by : AbstractIncidenceArray, AbstractSimulatedIncidenceMatrix, FrameData

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
SampleArrayData <- R6Class(
  inherit = ArrayData,
  public = list(
    initialize = function(data){
      if('array' %in% class(data)){
        private$.arr = data
        private$.dims = dim(data)
        private$.ndim = length(private$.dim)
        private$.dnames = dimnames(data)
      }
    }
  )
)

HopkinsIDD/ForecastFramework documentation built on May 28, 2019, 5:39 a.m.