Running ‘testthat.R’ [4s/4s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > if ( require(testthat) ) test_check("simputation")
  Loading required package: testthat
  Loading required package: simputation
  1. Error: EM imputation (@test_em.R#9) -----------------------------------------
  Invalid specification of predictors . - Sepal.Width:
  1: expect_equal(sum(is.na(impute_em(x, ~. - Sepal.Width))), 3) at testthat/test_em.R:9
  2: compare(object, expected, ...)
  3: impute_em(x, ~. - Sepal.Width)
  4: get_predictors(frm, dat)
  5: stop(sprintf("Invalid specification of predictors %s:", deparse(frm[[n]])), call. = FALSE)
  
  2. Error: missForest imputation (@test_em.R#40) --------------------------------
  Invalid specification of imputed variables: 'Species + Sepal.Length'
  1: expect_true(!any(is.na(impute_mf(dat, Species + Sepal.Length ~ Sepal.Width)))) at testthat/test_em.R:40
  2: expect(identical(as.vector(object), TRUE), sprintf("%s isn't true.", lab), info = info)
  3: as.expectation(exp, ..., srcref = srcref)
  4: identical(as.vector(object), TRUE)
  5: as.vector(object)
  6: impute_mf(dat, Species + Sepal.Length ~ Sepal.Width)
  7: get_imputed(formula, dat)
  8: stop(sprintf("Invalid specification of imputed variables: '%s'", deparse(frm[[2]])), 
         call. = FALSE)
  
  3. Error: sequential hot deck (@test_hd.R#12) ----------------------------------
  Invalid specification of imputed variables: 'x + y'
  1: expect_equal(impute_shd(dat, x + y ~ 1, pool = "univariate"), data.frame(x = c(1, 
         2, 2, 4), y = c(2, 2, 2, 8)), info = "unsorted univariate single hot deck") at testthat/test_hd.R:12
  2: compare(object, expected, ...)
  3: impute_shd(dat, x + y ~ 1, pool = "univariate")
  4: do_by(dat, groups(dat, formula), .fun = shd_work, formula = remove_groups(formula), 
         pool = pool, order = order, ...)
  5: .fun(dat, ...)
  6: get_imputed(formula, dat)
  7: stop(sprintf("Invalid specification of imputed variables: '%s'", deparse(frm[[2]])), 
         call. = FALSE)
  
  4. Error: random hot deck (@test_hd.R#45) --------------------------------------
  Invalid specification of imputed variables: 'x + y'
  1: expect_true(!is.na(sum(impute_rhd(dat, x + y ~ 1)))) at testthat/test_hd.R:45
  2: expect(identical(as.vector(object), TRUE), sprintf("%s isn't true.", lab), info = info)
  3: as.expectation(exp, ..., srcref = srcref)
  4: identical(as.vector(object), TRUE)
  5: as.vector(object)
  6: impute_rhd(dat, x + y ~ 1)
  7: get_imputed(formula, dat)
  8: stop(sprintf("Invalid specification of imputed variables: '%s'", deparse(frm[[2]])), 
         call. = FALSE)
  
  5. Error: knn-imputation (@test_hd.R#57) ---------------------------------------
  Invalid specification of imputed variables: 'x + y'
  1: expect_equal(impute_knn(dat, x + y ~ x + y, pool = "complete", k = 1), data.frame(x = c(2, 
         2, 4, 5), y = c(6, 7, 10, 10))) at testthat/test_hd.R:57
  2: compare(object, expected, ...)
  3: impute_knn(dat, x + y ~ x + y, pool = "complete", k = 1)
  4: do_by(dat, groups(dat, formula), .fun = knn_work, formula = remove_groups(formula), 
         pool = pool, k = k, ...)
  5: .fun(dat, ...)
  6: get_imputed(formula, dat)
  7: stop(sprintf("Invalid specification of imputed variables: '%s'", deparse(frm[[2]])), 
         call. = FALSE)
  
  6. Error: pmm-imputation (@test_hd.R#84) ---------------------------------------
  Invalid specification of imputed variables: 'y + z'
  1: expect_equal(impute_pmm(dat, y + z ~ x, pool = "multivariate"), data.frame(x = dat$x, 
         y = c(0.9, 2.1, 2.1, 2.1, 4.9), z = c(2.2, 3.8, 4.2, 3.8, 10.1))) at testthat/test_hd.R:84
  2: compare(object, expected, ...)
  3: impute_pmm(dat, y + z ~ x, pool = "multivariate")
  4: do_by(dat, groups(dat, formula), .fun = pmm_work, predictor = predictor, formula = remove_groups(formula), 
         pool = pool, ...)
  5: .fun(dat, ...)
  6: predictor(dat = dat, formula = formula, ...)
  7: do_by(dat, groups(dat, formula), .fun = lmwork, formula = remove_groups(formula), 
         add_residual = add_residual, fun = lm, na.action = na_action, ...)
  8: .fun(dat, ...)
  9: get_imputed(formula, dat)
  10: stop(sprintf("Invalid specification of imputed variables: '%s'", deparse(frm[[2]])), 
         call. = FALSE)
  
  7. Error: stuff gets imputed (@test_imputemodels.R#9) --------------------------
  Invalid specification of imputed variables: 'Sepal.Length + Sepal.Width'
  1: impute(irisNA, Sepal.Length + Sepal.Width ~ lm(Sepal.Length ~ Petal.Width + Species, 
         data = iris)) at testthat/test_imputemodels.R:9
  2: get_imputed(formula, dat)
  3: stop(sprintf("Invalid specification of imputed variables: '%s'", deparse(frm[[2]])), 
         call. = FALSE)
  
  8. Failure: formula parsing (@test_lm.R#5) -------------------------------------
  is_additive(expression(x + y)[[1]]) isn't true.
  
  
  9. Failure: formula parsing (@test_lm.R#6) -------------------------------------
  is_additive(expression(x - z)[[1]]) isn't true.
  
  
  10. Failure: formula parsing (@test_lm.R#7) ------------------------------------
  is_additive(expression(. - x)[[1]]) isn't true.
  
  
  11. Error: formula parsing (@test_lm.R#10) -------------------------------------
  Invalid specification of imputed variables: 'x + y'
  1: expect_equal(get_imputed(x + y ~ z, dat = data.frame(x = 0, y = 0, z = 0)), c("x", 
         "y")) at testthat/test_lm.R:10
  2: compare(object, expected, ...)
  3: get_imputed(x + y ~ z, dat = data.frame(x = 0, y = 0, z = 0))
  4: stop(sprintf("Invalid specification of imputed variables: '%s'", deparse(frm[[2]])), 
         call. = FALSE)
  
  12. Error: stuff gets imputed (@test_lm.R#42) ----------------------------------
  Invalid specification of imputed variables: 'Sepal.Length + Sepal.Width'
  1: expect_equal(sum(is.na(f(irisNA, Sepal.Length + Sepal.Width ~ 1))), 3, info = fun) at testthat/test_lm.R:42
  2: compare(object, expected, ...)
  3: f(irisNA, Sepal.Length + Sepal.Width ~ 1)
  4: do_by(dat, groups(dat, formula), .fun = lmwork, formula = remove_groups(formula), 
         add_residual = add_residual, fun = lm, na.action = na_action, ...)
  5: .fun(dat, ...)
  6: get_imputed(formula, dat)
  7: stop(sprintf("Invalid specification of imputed variables: '%s'", deparse(frm[[2]])), 
         call. = FALSE)
  
  13. Error: regression tests (@test_lm.R#110) -----------------------------------
  Invalid specification of imputed variables: '. - Sepal.Width'
  1: impute_lm(irisNA, . - Sepal.Width ~ 0 + Sepal.Width, weights = 1/iris$Sepal.Length) at testthat/test_lm.R:110
  2: do_by(dat, groups(dat, formula), .fun = lmwork, formula = remove_groups(formula), 
         add_residual = add_residual, fun = lm, na.action = na_action, ...)
  3: .fun(dat, ...)
  4: get_imputed(formula, dat)
  5: stop(sprintf("Invalid specification of imputed variables: '%s'", deparse(frm[[2]])), 
         call. = FALSE)
  
  14. Error: CART models (@test_tree.R#39) ---------------------------------------
  Invalid specification of imputed variables: 'x + y'
  1: expect_true(!any(is.na(impute_cart(dat, x + y ~ p, cp = 0.01))[, "x"])) at testthat/test_tree.R:39
  2: expect(identical(as.vector(object), TRUE), sprintf("%s isn't true.", lab), info = info)
  3: as.expectation(exp, ..., srcref = srcref)
  4: identical(as.vector(object), TRUE)
  5: as.vector(object)
  6: impute_cart(dat, x + y ~ p, cp = 0.01)
  7: do_by(dat, groups(dat, formula), .fun = cart_work, formula = remove_groups(formula), 
         add_residual = add_residual, cp, na_action = na_action, ...)
  8: .fun(dat, ...)
  9: get_imputed(formula, dat)
  10: stop(sprintf("Invalid specification of imputed variables: '%s'", deparse(frm[[2]])), 
         call. = FALSE)
  
  15. Error: RandomForest imputation (@test_tree.R#49) ---------------------------
  Invalid specification of imputed variables: 'Species + Sepal.Length'
  1: expect_true(!any(is.na(impute_rf(dat, Species + Sepal.Length ~ Sepal.Width)))) at testthat/test_tree.R:49
  2: expect(identical(as.vector(object), TRUE), sprintf("%s isn't true.", lab), info = info)
  3: as.expectation(exp, ..., srcref = srcref)
  4: identical(as.vector(object), TRUE)
  5: as.vector(object)
  6: impute_rf(dat, Species + Sepal.Length ~ Sepal.Width)
  7: do_by(dat, groups(dat, formula), .fun = rf_work, formula = remove_groups(formula), 
         add_residual = add_residual, na_action = na_action, ...)
  8: .fun(dat, ...)
  9: get_imputed(formula, dat)
  10: stop(sprintf("Invalid specification of imputed variables: '%s'", deparse(frm[[2]])), 
         call. = FALSE)
  
  testthat results ================================================================
  OK: 60 SKIPPED: 0 FAILED: 15
  1. Error: EM imputation (@test_em.R#9) 
  2. Error: missForest imputation (@test_em.R#40) 
  3. Error: sequential hot deck (@test_hd.R#12) 
  4. Error: random hot deck (@test_hd.R#45) 
  5. Error: knn-imputation (@test_hd.R#57) 
  6. Error: pmm-imputation (@test_hd.R#84) 
  7. Error: stuff gets imputed (@test_imputemodels.R#9) 
  8. Failure: formula parsing (@test_lm.R#5) 
  9. Failure: formula parsing (@test_lm.R#6) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted