Transform by group
transforms the data in a table or timetable using the computation in
G
= grouptransform(T
,groupvars
,method
)method
, grouping by the variables specified in
groupvars
. The output G
is a table or
timetable containing the transformed data in place of the nongrouping variables
from T
. For example, G =
grouptransform(T,'Gender','norm')
normalizes the data in
T
by gender using the 2-norm.
specifies additional grouping properties using one or more name-value pairs. For
example, G
= grouptransform(___,Name,Value
)G =
grouptransform(T,'Temp','linearfill','ReplaceValues',false)
appends the filled data as an additional variable of T
instead of replacing the nongrouping variables.
specifies additional grouping properties using one or more name-value pairs for
either of the previous array syntaxes.B
= grouptransform(___,Name,Value
)
When making many calls to grouptransform
, consider
converting grouping variables to type categorical
or
logical
when possible for improved performance. For
example, if you have a grouping variable of type char
(such
as Gender
with elements 'Male'
and
'Female'
), you can convert it to a categorical value
using the command categorical(Gender)
.
discretize
| findgroups
| groupcounts
| groupfilter
| groupsummary
| rowfun
| splitapply
| varfun