Description Usage Arguments Value See Also Examples
Create an iterator that splits a matrix into block columns.
You can specify either the number of blocks, using the chunks
argument, or the maximum size of the blocks, using the chunkSize
argument.
1 | isplitCols(x, ...)
|
x |
Matrix to iterate over. |
... |
Passed as the second and subsequent arguments to
|
An iterator that returns submatrices of x
.
1 2 3 4 5 6 7 8 9 10 11 12 | # Split a matrix into submatrices with a maximum of three columns
x <- matrix(1:30, 3)
it <- ihasNext(isplitCols(x, chunkSize=3))
while (hasNext(it)) {
print(nextElem(it))
}
# Split the same matrix into five submatrices
it <- ihasNext(isplitCols(x, chunks=5))
while (hasNext(it)) {
print(nextElem(it))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.