lifecycle::badge("experimental")
Container for the type of transformation used in
GeneratedPipeline
.
Note: For internal use.
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
rearrr::Transformation
-> GeneratedTransformation
name
Name of transformation.
fn
Transformation function.
args
list
of constant arguments for `fn`
.
generators
list
of generator functions
for generating argument values.
apply_generator
Generator function for deciding whether to apply the transformation to the current group.
Inherited methods
new()
Initialize transformation.
GeneratedTransformation$new(
fn,
args,
generators,
name = NULL,
group_cols = NULL
)
fn
Transformation function.
args
list
of constant arguments for `fn`
.
generators
Named list
of functions for generating argument values
for a single call of `fn`
.
It is possible to include an apply generator for deciding whether
the transformation should be applied to the current group or not.
This is done by adding a function with the name `.apply`
to the `generators`
list.
E.g. ".apply" = function(){sample(c(TRUE, FALSE), 1)}
.
name
Name of transformation.
group_cols
Names of columns to group data.frame
by before applying `fn`
.
When `NULL`
, the data.frame
is not grouped.
get_group_args()
Get arguments for a group.
GeneratedTransformation$get_group_args()
list
of arguments (both constant and generated).
generate_args()
Generate arguments for a group with the `generators`
.
GeneratedTransformation$generate_args()
list
of generated arguments.
Does not include the constant arguments.
print()
Print an overview of the transformation.
GeneratedTransformation$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.
GeneratedTransformation$clone(deep = FALSE)
deep
Whether to make a deep clone.
Other transformation classes:
FixedGroupsTransformation
,
Transformation