r8summarize() gives one row for each group of the rows of x by the key
columns by, or one row for the table without them: the keys, then the value
of each expression of columns for the group. Each expression is a calc() that
reads the cells of its columns within aggregates, evaluated in Rust: n(),
count(), sum(), mean(), median(), min(), and max(), alone or in an
expression, such as sum(w * x) / sum(w).
Arguments
- x
A value of a table.
- columns
Named list of
calc()values: The summaries, by the names of the result's columns.- by
Optional Character or numeric: The key columns, by name or by position.
- n_threads
Optional Integer [1, Inf): The threads that the work in Rust may use;
NULLtakesgetOption("r8.n_threads"), whose default is half the logical cores, at most 2 whereR CMD checklimits the cores, and at mostOMP_THREAD_LIMIT. A result is the same for any number of threads.
Value
A Raven of the key columns and the summaries, with the units that the expressions infer.
Groups
A group is one combination of the values of the keys that a row has. Groups are
in the order of r8sort() of the keys: ascending, missing last, strings by code
point, and factors by level. A missing key is one group; a level of a factor
without a row has no group. The key columns keep their kinds, levels, units, and
descriptions.