Other Matrix-Like Objects
Partitioned and sectioned matrices.
Note that PartMatrix objects maybe removed or deprecated, in the future.
VMap (n) PartMatrix (nr, nc, isep, jsep, ..., rnames, cnames, default.value=0) SectMatrix (nr, nc, ..., vmap, rnames, cnames, default.value=0) as.PartMatrix (x, isep, jsep, ..., rnames, cnames) as.SectMatrix (x, ..., vmap, rnames, cnames) n22 (...)
n |
Integer vector, the dimensions. |
nr, nc |
Integers, the number or rows and columns |
isep, jsep |
Optional integer vectors, the inter-row and inter-column indices. |
vmap |
A VMap object. |
rnames, cnames |
Character vectors giving the row and column names. |
default.value |
The default value of entries in the matrix. |
x |
A matrix or data.frame. |
... |
Ignored. |
A PartMatrix is a subclass of a SectMatrix.
(These are S4 classes, which are similar to NestMatrix).
A PartMatrix contains a matrix, along with a set of separator lines.
(These lines are included, when the object is formatted).
A SectMatrix is similar, but allows arbitrary rectangular sections, defined by the vmap argument.
A VMap object is a subclass of ObjectArray, that requires one or more two by two integer matrices.
Each two by two matrices defines the indices of the section.
The top row is the start and end indices for the rows, and the bottom row is the start and end indices for the columns.
A VMap can have two or more dimesions.
And a VMap is created by the PartMatrix constructor, which is two dimensional.
The n22 function is a convenience function for constructing a one dimensional VMap.
It takes a integer vector, where the length is a multiple of four.
Each consecutive set of four defines the indices for one section.
Within each set, each value describes the row start, row end, column start and column end, in that order.
Note that PartMatrix objects maybe removed or deprecated, in the future.
Also note, do not to access slots directly.
(But rather use functions within this package).
VMap, PartMatrix and SectMatrix are constructors for object of their classes.
n22 returns a VMAP object.
NestMatrix
Similar to PartMatrix.
x <- matrix (1:100, 10, 10) pm <- as.PartMatrix (x, 5, c (2, 4, 6, 8) ) pm pm [[1, 4]] vmap <- n22 ( 1, 10, #1 1, 10, 3, 10, #2 3, 10, 5, 10, #3 5, 10, 7, 10, #4 7, 10, 9, 10, #5 9, 10) sm <- as.SectMatrix (x, vmap=vmap) sm getSect (sm, 4)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.