8

I have a h2o object.

The standard R for subset

sub1<-trans[trans$Type==1,]

I tried the same in h2o. It is not working

sub1<-trans[trans$Type==1,]

I also tried

sub1<-h2o.exec(trans[trans$Type==1,])

note* trans is a h2o data Object.

Any idea to do it in h2o? Thanks

4

1 回答 1

5

我不确定这是否是最“亲水”的方式,但是:

transType <- trans$Type
sub1 <- trans[transType == 1,]

似乎对我有用,没有问题。

对于一个更具重现性的示例,请考虑

library(h2o)
localH2O <- h2o.init()

prosPath <- system.file("extdata", "prostate.csv", package = "h2o")
prostate.hex <- h2o.importFile(localH2O, path = prosPath)
prostate.hex[prostate.hex$GLEASON == 6,]
于 2014-12-04T14:36:48.367 回答