| collect | R Documentation |
Streams column chunks from the backing seed, applying deferred operations
and optional reductions on the fly. By default the result is returned as a
base matrix or vector; alternatively, supply a writer via into to stream
the output elsewhere (e.g., hdf5_writer()).
collect(
x,
into = NULL,
chunk_size = NULL,
chunk_margin = c("cols", "rows"),
target_bytes = NULL,
parallel = FALSE,
workers = NULL,
optimize = TRUE
)
x |
A |
into |
Optional writer or callback used to receive streamed chunks. |
chunk_size |
Optional chunk size along |
chunk_margin |
Chunking axis for non-reduction collection. |
target_bytes |
Optional memory budget (bytes) used to adapt chunk size. |
parallel |
Logical; attempt parallel chunk execution when safe. |
workers |
Number of worker processes when |
optimize |
Logical; run lightweight DAG optimizations before evaluation. |
A realised matrix/vector, or NULL invisibly when writing to
into.
# Basic materialization
mat <- matrix(1:12, nrow = 3, ncol = 4)
darr <- delarr(mat)
collect(darr)
# Collect after lazy operations
result <- darr |>
d_map(~ .x^2) |>
collect()
result
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.