Skip to content

Commit

Permalink
failing ifelse runit test added
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Wang committed May 4, 2015
1 parent a34a783 commit 34cc860
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions R/tests/testdir_misc/runit_NOPASS_ifelse.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
##
# Test: ifelse is added as method for H2OParsedData properly
# Description: push a dataset into H2O and convert column using ifelse
##

setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f")))
source('../findNSourceUtils.R')

test.ifelse <- function(conn) {

Log.info("Importing heart dataset into H2O...")
heart.hex <- as.h2o(h, object = heart)
Log.info("Change Surgery Column in R using bases' ifelse...")
heart$surgery <- ifelse(heart$surgery == 0, "N", "Y")
Log.info("Change Surgery Column in H2O using H2O's ifelse...")
heart.hex$surgery <- ifelse(heart.hex$surgery == 0, "N", "Y")

if(!all(heart$surgery == as.data.fram(heart.hex$surgery))) stop("Conversion of column different between h2o and base ifelse function!")

testEnd()
}

doTest("R and H2O ifelse Function", test.ifelse)

0 comments on commit 34cc860

Please sign in to comment.