| stream_sum | R Documentation |
Computes the sum of col across all partitions without collecting the full
dataset. When partitions are native-encoded, this avoids decoding string
columns entirely.
stream_sum(x, col, na_rm = TRUE)
x |
A |
col |
Column name to sum. |
na_rm |
Logical; drop NAs (default TRUE). |
A single numeric value giving the sum of the column across all partitions.
s <- schema(x = float64())
sink <- table_sink(s, mode = "row_groups")
table_write(sink, 1L, data.frame(x = c(1.0, 2.0, 3.0)))
rg <- table_finalize(sink)
stream_sum(rg, "x")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.