jeudi 27 juillet 2017

H2o R package: multiple ifelse conditions in h2o

I am trying to write a simple ifelse function in h2o R. Single ifelse works with no issues. But when I try to to even write a code with just two ifelse it gives me an error: my_cl$Seg<-ifelse((my_cl$predict==0), '1', ifelse(my_cl$predict==1), '2','0'))

Error: unexpected ')' in "my_cl$Seg<-ifelse((my_cl$predict==0), '1', ifelse(my_cl$predict==1), '2','0'))"

In regular R it would be correct. If I remove a ) Error in ifelse((my_cl$predict == 0), "1", ifelse(my_cl$predict == 1), : unused arguments ("2", "0")

Is it because in h2o the multiple ifelse are not supported? I tried to replace ifelse with h2o.ifelse - same errors. Thank you

Aucun commentaire:

Enregistrer un commentaire