| delarr_seed_nd | R Documentation |
delarrCreates a seed for arrays with 2 or more dimensions. The pull function receives a list of per-dimension index vectors and returns the corresponding sub-array.
delarr_seed_nd(
dims,
pull,
chunk_hint = NULL,
dimnames = NULL,
begin = NULL,
end = NULL
)
dims |
Integer vector of dimension extents (length >= 2). |
pull |
A function accepting a single argument |
chunk_hint |
Optional list describing preferred chunk sizes. |
dimnames |
Optional list of dimnames (one element per dimension). |
begin |
Optional function invoked before streaming begins. |
end |
Optional function invoked after streaming completes. |
An object of class delarr_seed.
arr <- array(seq_len(24), dim = c(3, 4, 2))
seed <- delarr_seed_nd(
dims = c(3, 4, 2),
pull = function(indices) {
idx <- lapply(seq_along(dim(arr)), function(k) indices[[k]] %||% seq_len(dim(arr)[k]))
do.call("[", c(list(arr), idx, list(drop = FALSE)))
}
)
dim(seed)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.