matrixIndex-class {externalVector}R Documentation

Class "matrixIndex", index class representing a set of row and column subscripts for a matrix


Objects of class "matrixIndex" represent subscripts corresponding to a submatrix of some matrix of a given size. Like the "vectorIndex" subclasses, this is a class for internal use.

Objects from the Class

Objects can be created by calls of the form new("matrixIndex", row, col, origdim, Names).


Object of class "vectorIndex", the row subscript.
Object of class "vectorIndex", the column subscript.
Object of class "integer", the dimension of the full matrix.
Object of class "vectorNamesType", names for the submatrix elements when the submatrix is treated as vectors.


Class "externalVector", directly.


Signature components for the methods are:

x The class "allIndex"
scalar Length one positive "integer"
i The class "ANY"
j The class "ANY"
drop The class "logical"
value The class "ANY"
.Object The class "allIndex"
x[i, j, drop=FALSE]
Create another object of cloass matrixIndex with same origdims represents a further submatrix of the full matrix. If drop is TRUE and at least one of the dimensions of the answer is 1, the answer is an object of class "vectorIndex" instead.
Get the subscript representing the indices for dimension i.
Get the dimension of x.
Get the dimnames of x.
Get the length of x considered as a vector. This is same as prod(dim(x)).
Get the names of x.
setDimNames(x, value)
Set the dimnames of x and return the modified x.
setNames(x, value)
Set the names of x and return the modified x.
as(x, "vectorIndex")
Coerce x to an object of class "vectorIndex".

See Also

vectorIndex-class for the class of row and column subscripts.

[Package externalVector version 1.0.14 Index]