h2o (version 3.2.0.3)

h2o.transform: Transform Columns in an H2OFrame Object.

Description

Functions that facilitate column transformations of an H2OFrame object.

Usage

h2o.transform(`_data`, ...)

h2o.within(data, expr, ...)

Arguments

_data,data
An H2OFrame object.
...
For transform method, column transformations in the form tag=value.
expr
For within method, column transformations specified as an expression.

See Also

transform, within for the base R methods.

Examples

Run this code
library(h2o)
localH2O <- h2o.init()
iris.hex <- as.h2o(iris, localH2O)
transformed1 <- transform(iris.hex,
                          Sepal.Ratio = Sepal.Length / Sepal.Width,
                          Petal.Ratio = Petal.Length / Petal.Width )
transformed1
transformed2 <- within(iris.hex,
                       {Sepal.Product <- Sepal.Length * Sepal.Width
                        Petal.Product <- Petal.Length * Petal.Width
                        Sepal.Petal.Ratio <- Sepal.Product / Petal.Product
                        Sepal.Length <- Sepal.Width <- NULL
                        Petal.Length <- Petal.Width <- NULL
                        })
transformed2

Run the code above in your browser using DataLab