Running ‘testBinaryCut.R’
  Running ‘testBinaryPredictor.R’
  Running ‘testCleanNaFromContinuous.R’
  Running ‘testCleanNaFromFactor.R’
  Running ‘testDiscretize.R’
  Running ‘testFocalPointQuery.R’
  Running ‘testGetStratifiedSample.R’
  Running ‘testMergeLevels.R’
  Running ‘testModelDefinition.R’
  Running ‘testPredictivePower.R’
  Running ‘testPreprocess.R’
  Running ‘testQuery.R’
  Running ‘testQueryFunctions.R’
  Running ‘testReliableModelCreation.R’
  Running ‘testReliableVariableCreation.R’
  Running ‘testToPmml.R’ [8s/11s]
  Running ‘testTransformationReplay.R’
  Running ‘testUploadGlmnetModel.R’
  Running ‘testWoe.R’
  Running ‘utils.R’
Running the tests in ‘tests/testTransformationReplay.R’ failed.
Complete output:
  > # Test variable transformation replay
  > # Author: David Barker
  > ###############################################################################
  > library(testthat)
  > library(Causata)
  > 
  > source("utils.R")
  > equals <- testthat::equals
  > 
  > context("TransformationReplay")
  > 
  > test_that("Applying MergeLevels can be replayed", {
  +   max.levels <- 3
  +   
  +   df <- data.frame(var__AP=c("a", "a", "a",  "b", "b",  "c", "d", "e", NA))
  +   cdata <- CausataData(df, rep(0,nrow(df)))
  +   cdata <- MergeLevels(cdata, max.levels=max.levels)
  +   transformer <- GetTransforms(cdata)
  +   
  +   # First, let's be sure that the merging has done what we expect.
  +   #expect_that(cdata$df$var__AP, is_identical_to(factor(c("a", "a", "a",  "b", "b",  "Other", "Other", "Other", NA))))
  +   f1 <- cdata$df$var__AP
  +   f2 <- factor(c("a", "a", "a",  "b", "b",  "Other", "Other", "Other", NA))
  +   expect_that(f1, is_equivalent_to(f2))
  +   
  +   # Now, create a new data.frame and apply the same transformation to it.  Any values in the factor we have
  +   # that is not "a", or "b" should be replaced with "Other"
  +   #
  +   new.df <- data.frame(var__AP=c("a", "b", "c", "c", "c", "d", "a", NA))
  +   transformed <- transformer(new.df)
  +   expect_that(transformed$var__AP, is_equivalent_to(factor(c("a", "b", "Other", "Other", "Other", "Other", "a", NA))))
  + })
  Error: Test failed: 'Applying MergeLevels can be replayed'
  * `x` not equivalent to `expected`.
  Types not compatible: character is not integer
  * `x` not equivalent to `expected`.
  Types not compatible: character is not integer
  Execution halted