Running a mungepiece achieves the same effect as running the mungebit attached to the mungepiece: the first time it is run, we train the mungebit so it remembers metadata it will need to replicate the operation in a live production setting on a single row of data. The second and subsequent times we run the mungepiece, it will execute the predict function of the underlying mungebit.

mungepiece_run(data, ..., `_envir` = parent.frame())

Arguments

data

environment or data.frame. Essentially an environment containing a data variable. In this case, that data variable will have a side effect enacted on it. If a data.frame, then the return value will be the modified data.frame and the mungebit will record any results it must memorize in its input.

...

additional arguments to the mungebit's train_function or predict_function.

_envir

environment. The calling environment for the train or predict function on the underlying mungebit. This is an internal argument and is parent.frame() by default.

Value

If the data parameter is an environment, the transformed environment (i.e., the transformed data in the environment) after application of the underlying mungebit. If data is a data.frame, the transformed data.frame is returned.