H2O R中的子集 [英] Subsetting in H2O R

查看:87
本文介绍了H2O R中的子集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个h2o对象.

子集的标准R

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

我在h2o中尝试了相同的方法.它不起作用

I tried the same in h2o. It is not working

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

我也尝试过

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

note * trans是一个h2o数据对象.

note* trans is a h2o data Object.

有什么想法可以在水中进行吗?谢谢

Any idea to do it in h2o? Thanks

推荐答案

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

I'm not sure if this is the most "hydrophilic" way to do this but:

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

似乎可以毫无问题地为我工作.

Seems to work for me with no problem.

有关更可重复的示例,请考虑

For a more reproducible example, consider

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,]

这篇关于H2O R中的子集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆