From b63c42b6838b630a5e9ad042737c4d00b61597b0 Mon Sep 17 00:00:00 2001 From: Tomas Nykodym Date: Tue, 24 Feb 2015 18:42:46 -0800 Subject: [PATCH] Fix bug in as.h2o. h2o.exec call (for turning cols into enums) was somehow overwriting h2odataset object in outer scope. replaced h2o.exec call with simple as.factor. --- R/h2o-package/R/Classes.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/h2o-package/R/Classes.R b/R/h2o-package/R/Classes.R index 7f2797ffdd..5474de8077 100755 --- a/R/h2o-package/R/Classes.R +++ b/R/h2o-package/R/Classes.R @@ -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) }