20_ObjectArray: Object Arrays

Description Usage Arguments Details Value See Also Examples

Description

One, two and higher-dimensional object arrays.

NOTE:
INTERNAL STRUCTURE OF OBJECTS IS SUBJECT TO CHANGE.
DO NOT USE SLOTS, DIRECTLY.

Usage

1
2
3
ObjectArray (n, ..., CLASS="<OBJECT>", names, default.value=NULL)

as.ObjectArray (v, ..., n, CLASS="<OBJECT>", names)

Arguments

CLASS

A character vector of classes.
Every object in the object array, needs to be of these classes.
Note that the order is not important.

The default, "<OBJECT>", means that objects can be of any class.

n

Positive integer vector, the dimensions.

names

List of character vectors, of names in each dimension, which should match n, above.
May be NULL or contain NULL values.

default.value

Default value, for each element.

v

In as.ObjectArray, a list.
In as.NestMatrix, a matrix or a PartMatrix.

...

Ignored.

Details

ObjectArray(s) are similar to list matrices and list arrays.
(But these are S4 classes, with a number of differences).

Setting individual elements to NULL, doesn't remove them.
And they support formatting, via objtag methods.

By default, an ObjectArray can contain any objects, however, this can be restricted by the CLASS argument.

Value

An ObjectArray object.

See Also

Subclasses:
ImageArray
GeomArray
NestMatrix
MatrixArray

PartMatrix, SectMatrix
Similar to NestMatrix.

Subsetting Operators

Standard Methods

Binary Operators
Operations on MatrixArray objects.

Examples

1
2
3
4
5
6
7
8
v <- ObjectArray (c (2, 2), CLASS="list")
v [[1, 1]] <- list (1)
v [[2, 1]] <- list (1, 2)
v [[1, 2]] <- list (1, 2, 3)
v [[2, 2]] <- list (1, 2, 3, 4)
v

v [[1, 2]]

vectools documentation built on June 7, 2021, 9:08 a.m.