lifecycle::badge("experimental")
Container for the type of transformation used in
FixedGroupsPipeline
.
Note: For internal use.
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
rearrr::Transformation
-> FixedGroupsTransformation
name
Name of transformation.
fn
Transformation function.
args
list
of constant arguments for `fn`
.
var_args
list
of arguments for `fn`
with different values per group.
num_groups
Number of groups that the transformation expects.
apply_arg
list
of TRUE
/FALSE
flags indicating
whether the transformation should be applied to each of the groups.
When `NULL`
, the transformation is applied to all groups.
new()
Initialize transformation.
FixedGroupsTransformation$new(fn, args, var_args, name = NULL)
fn
Transformation function.
args
list
of constant arguments for `fn`
.
var_args
list
of arguments for `fn`
with different values per group.
Each argument should have a list of values (one per group).
By adding ".apply"
with a list of TRUE
/FALSE
flags, the transformation
can be disabled for a specific group.
E.g. list(".apply" = list(TRUE, FALSE, TRUE), ...
.
name
Name of transformation.
get_group_args()
Get arguments for specific group ID.
FixedGroupsTransformation$get_group_args(group_id)
group_id
ID of the group to get arguments for.
list
of arguments.
apply()
Apply the transformation to a data.frame
.
FixedGroupsTransformation$apply(data)
data
data.frame
with the expected number of groups.
Transformed version of `data`
.
print()
Print an overview of the transformation.
FixedGroupsTransformation$print(..., indent = 0, show_class = TRUE)
...
further arguments passed to or from other methods.
indent
How many spaces to indent when printing.
show_class
Whether to print the transformation class name.
The pipeline. To allow chaining of methods.
clone()
The objects of this class are cloneable with this method.
FixedGroupsTransformation$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other transformation classes:
GeneratedTransformation
,
Transformation