Description Usage Arguments Details Value See Also Examples
Block matrices.
(NestMatrix and PartMatrix objects).
PartMatrix objects are generalized by SectMatrix objects, which allow overlapping sections.
Note that PartMatrix objects maybe removed or deprecated, in the future.
NOTE:
INTERNAL STRUCTURE OF OBJECTS IS SUBJECT TO CHANGE.
DO NOT USE SLOTS, DIRECTLY.
1 2 3 4 5 6 7 8 9 10 11 12 13 | VMap (n)
NestMatrix (nr, nc, ..., rnames, cnames, conform=TRUE, recursive=FALSE,
default.value=ZERO)
as.NestMatrix (v, ..., rnames, cnames, conform=TRUE, recursive=FALSE)
PartMatrix (nr, nc, rsep, csep, ..., rnames, cnames, default.value=0)
SectMatrix (nr, nc, ..., vmap, rnames, cnames, default.value=0)
as.PartMatrix (v, rsep, csep, ..., rnames, cnames)
as.SectMatrix (v, ..., vmap, rnames, cnames)
n22 (...)
|
n |
Integer, the number of submatrices. |
nr, nc |
Integers, the number or rows and columns |
rsep, csep |
Optional integer vectors, the inter-row and inter-column indices. |
vmap |
A VMap object. |
rnames, cnames |
Character vectors of nr row names and nc column names. |
default.value |
The default value of entries in the matrix. |
v |
A matrix or data.frame. |
conform |
Logical, if true, submatrices are required to have conformable dimensions. |
recursive |
Logical, if true, subelements can be nested matrices. |
... |
Ignored. |
A NestMatrix is a subclass of an ObjectArray that contains ZERO or standard matrices.
If recursive is true, then it may also contain other NestMatrix objects.
Note that NestMatrix elements can have a scalar value assigned, but it will be converted to a 1x1 matrix.
A PartMatrix is a subclass of a SectMatrix.
(These are similar to NestMatrix).
A PartMatrix contains a matrix, along with a set of separator lines.
(These lines are included, when the object is printed/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 more than one dimensions.
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.
VMap, NestMatrix, PartMatrix and SectMatrix are constructors for object of their classes.
n22 returns a VMAP object.
ObjectArray
Subsetting Operators
Standard Methods
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | x <- matrix (1:100, 10, 10)
###########
#NestMatrix
###########
msub <- NestMatrix (4, 4)
nm1 <- NestMatrix (4, 4)
nm2 <- NestMatrix (4, 4, recursive=TRUE, default.value=msub)
nm3 <- as.NestMatrix (PartMatrix (5, 5, 2:4, 2:4) )
nm1
nm2
nm3
###########
#PartMatrix
###########
pm <- as.PartMatrix (x, 5, c (2, 4, 6, 8) )
pm
pm [[1, 4]]
###########
#SectMatrix
###########
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.