chunked-class | R Documentation |
The chunked
class implements chunked wrappers for vectors, arrays, and lists for parallel iteration.
## Instance creation
chunked_vec(x, nchunks = NA, chunksize = NA,
verbose = FALSE, permute = FALSE, depends = NULL, drop = FALSE)
chunked_mat(x, margin, nchunks = NA, chunksize = NA,
verbose = FALSE, permute = FALSE, depends = NULL, drop = FALSE)
chunked_list(..., nchunks = NA, chunksize = NA,
verbose = FALSE, permute = FALSE, depends = NULL, drop = FALSE)
## Additional methods documented below
x , ... |
The data to be chunked. If multiple objects are passed via ..., then they are all recycled to the same length. |
nchunks |
The number of chunks to use. If |
chunksize |
The approximate chunk size in bytes. If |
verbose |
Should messages be printed whenever a chunk is extracted? |
permute |
Should the order of items be randomized? Alternatively, an integer vector or a list of integer vectors can be specified. If an integer vector is provided, then |
depends |
A list with length equal to the extent of |
margin |
Which array margin should be chunked. |
drop |
The value passed to |
An object derived from class chunked
.
data
:The data.
index
:The chunk indices.
verbose
:Print messages on chunk extraction?
drop
:The value passed to drop
when subsetting the chunks.
margin
:The array margin for the chunks.
chunked_vec
, chunked_mat
and chunked_list
instances can be created through chunked_vec()
, chunked_mat()
, and chunked_list()
, respectively.
Standard generic methods:
length(x):
Get number of chunks.
lengths(x):
Get chunk sizes for each chunk.
x[i, ...]
:Get chunks.
x[[i]]
:Get a single chunk.
Kylie A. Bemis
chunkApply
x <- matrix(runif(200), nrow=10, ncol=20)
y <- chunked_mat(x, margin=2, nchunks=5)
print(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.