matter_list-class {matter} | R Documentation

## Out-of-Memory Lists of Vectors

### Description

The `matter_list` class implements out-of-memory lists.

### Usage

    ## Instance creation
    matter_list(data, datamode = "double", paths = NULL,
                filemode = ifelse(all(file.exists(paths)), "r", "rw"),
                offset = c(0, cumsum(sizeof(datamode) * extent)[-length(extent)]),
                extent = lengths, lengths = 0, names = NULL, dimnames = NULL,
                chunksize = getOption("matter.default.chunksize"), ...)

    ## Additional methods documented below

### Arguments

`data` | An optional data list which will be initially written to the data in virtual memory if provided.
`datamode` | A 'character' vector giving the storage mode of the data in virtual memory. Allowable values are the C types ('char', 'uchar', short', 'ushort', 'int', 'uint', 'long', 'ulong', 'float') and their R equivalents ('raw', 'logical', 'integer', 'numeric'). See `?datatypes` for details.
`paths` | A 'character' vector of the paths to the files where the data are stored. If 'NULL', then a temporary file is created using `tempfile`.
`filemode` | The read/write mode of the files where the data are stored. This should be 'r' for read-only access, or 'rw' for read/write access.
`offset` | A vector giving the offsets in number of bytes from the beginning of each file in 'paths', 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 'paths', specifying the number of elements of size 'datamode' to be accessed from each file.
`lengths` | A vector giving the length of each element of the list.
`names` | The names of the data elements.
`dimnames` | The names of the data elements' data elements.
`chunksize` | The (suggested) maximum number of elements which should be accessed at once by summary functions and linear algebra. Ignored when explicitly subsetting the dataset.
`...` | Additional arguments to be passed to constructor.

### Value

An object of class `matter_list`.

### Slots

`data`:

  This slot stores the information about locations of the data in virtual memory and within the files.

`datamode`:

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

`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 'r' for read-only access, or 'rw' 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.

### Extends

`matter`

### Creating Objects

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

### Methods

Standard generic methods:

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

  Get or set a single element of the list.

`x[[i, j]]`:

  Get the `j`th sub-elements of the `i`th element of the list.

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

  Get or set the `i`th 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]]

[Package matter version 1.20.0 Index]