matter_fct-class: Out-of-Core Factors

matter_fct-classR Documentation

Out-of-Core Factors

Description

The matter_fct class implements out-of-core factors.

Usage

## Instance creation
matter_fct(data, levels, type = typeof(levels), path = NULL,
    length = NA_integer_, names = NULL, offset = 0, extent = NA_real_,
    readonly = NA, append = FALSE, labels = as.character(levels), ...)

## Additional methods documented below

Arguments

data

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

levels

The levels of the factor. These should be of the same type as the data. (Use labels for the string representation of the levels.)

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").

length

The length of the factor.

names

The names of the data 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.

labels

An optional character vector of labels for the factor levels.

...

Additional arguments to be passed to constructor.

Value

An object of class matter_fct.

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.

levels:

The levels of the factor.

labels:

The labels for the levels.

Extends

matter, matter_vec

Creating Objects

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

Methods

Standard generic methods:

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

Get or set length.

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

Get or set 'names'.

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

Get or set the elements of the factor.

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

Get or set the levels of the factor.

Author(s)

Kylie A. Bemis

See Also

matter, matter_vec

Examples

x <- matter_fct(rep(c("a", "a", "b"), 5), levels=c("a", "b", "c"))
x

kuwisdelu/matter documentation built on Oct. 19, 2024, 10:31 a.m.