matter-class: Vectors, Matrices, and Arrays Stored on Disk

Description Usage Arguments Value Slots Creating Objects Methods Author(s) See Also Examples

Description

The matter class and its subclasses are designed for easy on-demand read/write access to binary on-disk data structures, and working with them as vectors, matrices, arrays, lists, and data frames.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Instance creation
matter(...)

# Check if an object is a matter object
is.matter(x)

# Coerce an object to a matter object
as.matter(x, ...)

## Additional methods documented below

Arguments

...

Arguments passed to subclasses.

x

An object to check if it is a matter object or coerce to a matter object.

Value

An object of class matter.

Slots

data:

This slot stores the information about locations of the data on disk and within the files.

datamode:

The storage mode of the accessed data when read into R. This should a 'character' vector of length one with value 'integer' or 'numeric'.

paths:

A 'character' vector of the paths to the files where the data are stored.

filemode:

The read/write mode of the files where the data are stored. This should be 'rb' for read-only access, or 'rb+' for read/write access.

chunksize:

The maximum number of elements which should be loaded into memory at once. Used by methods implementing summary statistics and linear algebra. Ignored when explicitly subsetting the dataset.

length:

The length of the data.

dim:

Either 'NULL' for vectors, or an integer vector of length one of more giving the maximal indices in each dimension for matrices and arrays.

names:

The names of the data elements for vectors.

dimnames:

Either 'NULL' or the names for the dimensions. If not 'NULL', then this should be a list of character vectors of the length given by 'dim' for each dimension. This is always 'NULL' for vectors.

ops:

Delayed operations to be applied on atoms.

Creating Objects

matter is a virtual class and cannot be instantiated directly, but instances of its subclasses can be created through matter().

Methods

Class-specific methods:

atomdata(x):

Access the 'data' slot.

adata(x):

An alias for atomdata(x).

datamode(x), datamode(x) <- value:

Get or set 'datamode'.

paths(x), paths(x) <- value:

Get or set 'paths'.

filemode(x), filemode(x) <- value:

Get or set 'filemode'.

readonly(x), readonly(x) <- value:

A shortcut for getting or setting 'filemode'.

chunksize(x), chunksize(x) <- value:

Get or set 'filemode'.

Standard generic methods:

length(x), length(x) <- value:

Get or set 'length'.

dim(x), dim(x) <- value:

Get or set 'dim'.

names(x), names(x) <- value:

Get or set 'names'.

dimnames(x), dimnames(x) <- value:

Get or set 'dimnames'.

Author(s)

Kylie A. Bemis

See Also

matter_vec, matter_mat, matter_arr, matter_list, matter_fc, matter_str, matter_df

Examples

1
2
3
4
5
6
7
## Create a matter_vec vector
x <- matter(1:100, length=100)
x[]

## Create a matter_mat matrix
x <- matter(1:100, nrow=10, ncol=10)
x[]

matter documentation built on Dec. 14, 2018, 6:01 p.m.