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