FUNCTION REFERENCE
groupsummary
Summary statistics by group.
Summary statistics by group.
Syntax
G = groupsummary(T, groupvars)Syntax
G = groupsummary(T, groupvars, method, datavars)Syntax
[B, BG, BC] = groupsummary(A, groupvars, method)Methods: mean, sum, min, max, range, median, mode, var, std, numel, nnz, nummissing (missing values omitted), or function handles (results named fun1_x, fun2_x, ...). The output table has the group values, GroupCount and one variable per data variable and method (method_variable). Missing group values form their own group unless 'IncludeMissingGroups' is false.
Example
groupsummary(table({'a';'b';'a'}, [1;2;3], 'VariableNames', {'k','x'}), 'k', 'mean')Differences from MATLAB: No group bins, 'IncludeEmptyGroups' or 'all' method; several methods on several variables are ordered variable by variable.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.