Skip to content

Commit

Permalink
Fix bug in as.h2o. h2o.exec call (for turning cols into enums) was so…
Browse files Browse the repository at this point in the history
…mehow overwriting h2odataset object in outer scope.

replaced h2o.exec call with simple as.factor.
  • Loading branch information
tomasnykodym committed Feb 25, 2015
1 parent 31f0873 commit b63c42b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/h2o-package/R/Classes.R
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ as.h2o <- function(client, object, key = "", header, sep = "") {
toFactor <- names(which(unlist(lapply(object, is.factor))))
write.csv(object, file=tmpf, quote = TRUE, row.names = FALSE)
h2f <- h2o.uploadFile(client, tmpf, key=key, header=header, sep=sep)
invisible(lapply(toFactor, function(a) { h2o.exec(h2f[,a] <- factor(h2f[,a])) }))
invisible(lapply(toFactor, function(a) { h2f[,a] <- as.factor(h2f[,a]) }))
unlink(tmpf)
return(h2f)
}
Expand Down

0 comments on commit b63c42b

Please sign in to comment.