GeneratedTransformation {rearrr}R Documentation

GeneratedTransformation

Description

[Experimental]

Container for the type of transformation used in GeneratedPipeline.

Note: For internal use.

Super class

rearrr::Transformation -> GeneratedTransformation

Public fields

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.

Methods

Public methods

Inherited methods

Method new()

Initialize transformation.

Usage
GeneratedTransformation$new(
  fn,
  args,
  generators,
  name = NULL,
  group_cols = NULL
)
Arguments
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.


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.

indent

How many spaces to indent when printing.

show_class

Whether 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
deep

Whether to make a deep clone.

Author(s)

Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk

See Also

Other transformation classes: FixedGroupsTransformation, Transformation


[Package rearrr version 0.3.4 Index]