| GeneratedTransformation {rearrr} | R Documentation |
GeneratedTransformation
Description
Container for the type of transformation used in
GeneratedPipeline.
Note: For internal use.
Super class
rearrr::Transformation -> GeneratedTransformation
Public fields
nameName of transformation.
fnTransformation function.
argslistof constant arguments for`fn`.generatorslistof generator functions for generating argument values.apply_generatorGenerator function for deciding whether to apply the transformation to the current group.
Methods
Public methods
Inherited methods
Method new()
Initialize transformation.
Usage
GeneratedTransformation$new( fn, args, generators, name = NULL, group_cols = NULL )
Arguments
fnTransformation function.
argslistof constant arguments for`fn`.generatorsNamed
listof 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)}.nameName of transformation.
group_colsNames of columns to group
data.frameby before applying`fn`.When
`NULL`, thedata.frameis not grouped.
Method get_group_args()
Get arguments for a group.
Usage
GeneratedTransformation$get_group_args()
Returns
list of arguments (both constant and generated).
Method generate_args()
Generate arguments for a group with the `generators`.
Usage
GeneratedTransformation$generate_args()
Returns
list of generated arguments.
Does not include the constant arguments.
Method print()
Print an overview of the transformation.
Usage
GeneratedTransformation$print(..., indent = 0, show_class = TRUE)
Arguments
...further arguments passed to or from other methods.
indentHow many spaces to indent when printing.
show_classWhether to print the transformation class name.
Returns
The pipeline. To allow chaining of methods.
Method clone()
The objects of this class are cloneable with this method.
Usage
GeneratedTransformation$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Author(s)
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
See Also
Other transformation classes:
FixedGroupsTransformation,
Transformation