CaliperMatrix: CaliperMatrix class

Description Details Public fields Active bindings Methods

Description

CaliperMatrix class

CaliperMatrix class

Details

This class makes it easier to interact with Caliper matrices in R.

See vignette("caliper-matrices") for more details on interacting with matrices. This includes info on S3 methods for bringing them into R formats like data.frames and as.matrix.

Public fields

handle

This is a COM pointer and represents the object in Caliper software.

cores

This is a named list of cores. Each element contains a MatrixCurrency-class.

indices

This lists the row and column indices available for the matrix.

Active bindings

row_index

This can be used to retrieve or set the current row index.

column_index

This can be used to retrieve or set the current column index.

Methods

Public methods


Method new()

Create a new CaliperMatrix object.

Usage
CaliperMatrix$new(matrix)
Arguments
matrix

Either the file path to the matrix (.mtx) or a COM pointer to the matrix handle.

Returns

a new CaliperMatrix object.


Method create_index_info()

Sets the indices field of the CaliperMatrix.

Usage
CaliperMatrix$create_index_info()

Method create_core_list()

Sets the cores field of the CaliperMatrix.

Usage
CaliperMatrix$create_core_list()

Method update_gisdk_data()

Sends R data back to the matrix in Caliper software.

Usage
CaliperMatrix$update_gisdk_data(core_name, data)
Arguments
core_name

string The name of the core to update.

data

matrix of data.


Method CreateCore()

Create a new core in the matrix.

Usage
CaliperMatrix$CreateCore(core_name)
Arguments
core_name

string The name of the core to create.


Method CreateIndex()

Create a new index.

Usage
CaliperMatrix$CreateIndex(
  index_name,
  current_ids,
  new_ids = NULL,
  index_type = c("both", "row", "column")
)
Arguments
index_name

string The name of the new index.

current_ids

vector of the row/column IDs to include in new index.

new_ids

vector Use this to assign new IDs to the rows/columns of this index if desired.

index_type

string Whether the index can be applied to rows, column, or (the default) both.


Method clone()

The objects of this class are cloneable with this method.

Usage
CaliperMatrix$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


dkyleward/caliperR documentation built on Dec. 31, 2021, 7:11 p.m.