matter_str-class: Out-of-Memory Strings

matter_str-classR Documentation

Out-of-Memory Strings

Description

The matter_str class implements out-of-memory strings.

Usage

## Instance creation
matter_str(data, encoding, path = NULL,
    nchar = 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.

encoding

The character encoding to use (if known).

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.

nchar

A vector giving the length of each element of the character vector.

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.

...

Additional arguments to be passed to constructor.

Value

An object of class matter_str.

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.

encoding:

The string encoding used.

Extends

matter_list

Creating Objects

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

Methods

Standard generic methods:

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

Get or set the string elements of the vector.

lengths(x):

Get the number of characters (in bytes) of all string elements in the vector.

Author(s)

Kylie A. Bemis

See Also

matter

Examples

x <- matter_str(rep(c("hello", "world!"), 50))
x

kuwisdelu/matter documentation built on May 1, 2024, 5:17 a.m.