NOTE:
INTERNAL STRUCTURE OF OBJECTS IS SUBJECT TO CHANGE.
DO NOT USE SLOTS, DIRECTLY.
Usage
ObjectArray (n, …, CLASS="
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.
Value
An ObjectArray object.
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.
# NOT RUN {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]]
# }