| stream_group_count | R Documentation |
Counts rows per group across partitions without collecting. Optimized for
factor groups (factor_col()).
stream_group_count(x, group)
x |
A |
group |
Group column name (recommended: |
A data.frame with columns group (factor) and n (integer).
s <- schema(g = factor_col(c("a", "b")), x = float64())
sink <- table_sink(s, mode = "row_groups")
table_write(sink, 1L,
data.frame(g = factor(c("a", "b", "a"), levels = c("a", "b")), x = c(1, 2, 3)))
rg <- table_finalize(sink)
stream_group_count(rg, "g")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.