matter_list-class: Out-of-Core Lists of Vectors

matter_list-classR Documentation

Out-of-Core Lists of Vectors

Description

The matter_list class implements out-of-core lists.

Usage

## Instance creation
matter_list(data, type = "double", path = NULL,
    lengths = NA_integer_, names = NULL, offset = 0, extent = NA_real_,
    readonly = NA, append = FALSE, ...)

## Additional methods documented below

Arguments

data

An optional data vector which will be initially written to virtual memory if provided.

type

A 'character' vector giving the storage mode of the data in virtual memory. See ?"matter-types" for possible values.

path

A 'character' vector of the path(s) to the file(s) where the data are stored. If NULL, then a temporary file is created using tempfile, which will be managed according the getOption("matter.temp.gc").

lengths

The lengths of the list elements.

names

The names of the list elements.

offset

A vector giving the offsets in number of bytes from the beginning of each file in 'path', specifying the start of the data to be accessed for each file.

extent

A vector giving the length of the data for each file in 'path', specifying the number of elements of size 'type' to be accessed from each file.

readonly

Whether the data and file(s) should be treated as read-only or read/write.

append

If TRUE, then all offsets will be adjusted to be from the end-of-file (for all files in path), and readonly will be set to FALSE.

...

Additional arguments to be passed to constructor.

Value

An object of class matter_list.

Slots

data:

This slot stores any information necessary to access the data for the object (which may include the data itself and/or paths to file locations, etc.).

type:

The storage mode of the accessed data when read into R. This is a 'factor' with levels 'raw', 'logical', 'integer', 'numeric', or 'character'.

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.

Extends

matter

Creating Objects

matter_list instances can be created through matter_list() or matter().

Methods

Class-specific methods:

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

Get or set the data source names, i.e., file path(s).

fetch(x, ...):

Pull data into shared memory.

flash(x, ...):

Push data to a temporary file.

Standard generic methods:

x[[i]], x[[i]] <- value:

Get or set a single element of the list.

x[[i, j]]:

Get the jth sub-elements of the ith element of the list.

x[i], x[i] <- value:

Get or set the ith elements of the list.

lengths(x):

Get the lengths of all elements in the list.

Author(s)

Kylie A. Bemis

See Also

matter

Examples

x <- matter_list(list(c(TRUE,FALSE), 1:5, c(1.11, 2.22, 3.33)), lengths=c(2,5,3))
x[]
x[1]
x[[1]]

x[[3,1]]
x[[2,1:3]]

kuwisdelu/matter documentation built on Dec. 8, 2024, 8:09 p.m.