Description Usage Arguments Value See Also Examples
A mungebit which affects multiple columns identically and independently can be abstracted into a column transformation. This function allows one to specify what happens to an individual column, and the mungebit will be the resulting column transformation applied to an arbitrary combination of columns.
1 | column_transformation(transformation, mutating = FALSE, named = FALSE)
|
transformation |
a function. The only argument should be the original column. |
mutating |
a logical. Announces whether the transformation passed in attempts to maintain state between prediction and training runs using the "inputs" global. |
named |
a logical. Whether or not the transformation should be passed an atomic vector, or a list of length 1 whose single element is given the same name as the column currently being processed. |
a function which takes a data.frame and a vector of columns and applies the transformation.
1 2 3 | doubler <- column_transformation(function(x) 2*x)
# doubles the Sepal.Length column in the iris dataset
doubler(iris, c('Sepal.Length'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.