add_group {deident} | R Documentation |
Add aggregation to pipelines
Description
add_group()
allows for the injection of aggregation into the transformation
pipeline. Should you need to apply a transformation under aggregation (e.g.
add_shuffle
) this helper creates a grouped data.frame
as would be done
with dplyr::group_by()
.
The function add_ungroup()
is supplied to perform the inverse operation.
Usage
add_group(object, ...)
add_ungroup(object, ...)
Arguments
object |
Either a |
... |
Variables on which data is to be grouped. |
Value
A 'DeidentList' representing the untrained transformation pipeline. The object contains fields:
-
deident_methods
a list of each step in the pipeline (consisting ofvariables
andmethod
)
and methods:
-
mutate
apply the pipeline to a new data set -
to_yaml
serialize the pipeline to a '.yml' file
Examples
pipe.grouped <- add_group(ShiftsWorked, Date, Shift)
pipe.grouped_shuffle <- add_shuffle(pipe.grouped, `Daily Pay`)
add_ungroup(pipe.grouped_shuffle, `Daily Pay`)
[Package deident version 1.0.0 Index]