Any equivalent of pmax in R?

25 views
Skip to first unread message

Denis Perevalov

unread,
May 24, 2016, 11:40:48 AM5/24/16
to H2O Open Source Scalable Machine Learning - h2ostream
Is there a simple way to transform H2O data like pmax where I would max out each element of a vector? I'm using R interface.

For example

irisPath <- system.file("extdata", "iris_wheader.csv", package = "h2o")
iris.hex <- h2o.uploadFile(path = irisPath, destination_frame = "iris.hex")

Let's say I want to put a lower bound on sepal_len:

print(pmax(iris.hex$sepal_len, 1))
Warning message:
In any(nas): coercing argument of type 'list' to logical
Error in each[change]: invalid subscript type 'environment'


Normally in R one can do this:
test = c(1, 2, 4.5, 6.7, 0.5)
print(pmax(test, 1.0))

which would produce
[1] 1.0 2.0 4.5 6.7 1.0

Thanks!
Reply all
Reply to author
Forward
0 new messages