timetable

Methods

Method Reference: timetable.pivot

timetable: P = pivot (tt, Name, Value, …)

Summarise a timetable across two grouping dimensions.

P = pivot (tt, 'Rows', rowvars, 'Columns', colvars) groups the rows of tt by rowvars down the page and by colvars across it, and returns a table holding one row per row group and one variable per column group. At least one of the two must be given.

Either may name the row dimension, which groups by the row times: as 'Rows' they become a variable of the result, and as 'Columns' they name its variables. The result is a table and not a timetable, its rows and columns being groups rather than instants.

With no 'DataVariable' the cells count the rows of each group; with one they summarise its values, by 'Method', which defaults to summing them.

The following Name/Value pairs are accepted:

'Rows', 'Columns'
The variables grouping down the page and across it, or the row dimension name.
'DataVariable'
The variable summarised in each cell.
'Method'
The summary applied to each cell, a method name or a function handle.
'RowsBinMethod', 'ColumnsBinMethod'
Binning applied to the grouping variables before grouping, with 'IncludedEdge' saying which edge of a bin is included.
'IncludeMissingGroups', 'IncludeEmptyGroups'
Whether a group of missing values, and whether an unused category, are reported.
'IncludeTotals'
Whether a marginal row and column are added, labelled Overall_<method>.
'RowLabelPlacement'
Whether the row groups become a variable of the result or its row names.
'OutputFormat'
'flat' (the default) or 'nested', which groups the data variables into nested tables by the column hierarchy.

See also: groupsummary, timetable

Source Code: timetable