Running ‘testthat.R’ [134s/144s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(vivid)
  > 
  > test_check("vivid")
  
  Attaching package: 'dplyr'
  
  The following object is masked from 'package:testthat':
  
      matches
  
  The following objects are masked from 'package:stats':
  
      filter, lag
  
  The following objects are masked from 'package:base':
  
      intersect, setdiff, setequal, union
  
  Embedded permutation variable importance method used.
  Calculating interactions...
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  vivid
   --- call from context --- 
  vividImportance.Learner(data = data, fit = fit, response = response, 
      importanceType = importanceType, predictFun = pFun)
   --- call from argument --- 
  if (fit$packages == "xgboost") {
      importance <- fit$importance()
      message("Embedded variable importance method used.")
      impNames <- names(importance)
      differernceNames <- setdiff(featureNames, impNames)
      importance <- c(importance, setNames(0, differernceNames))
      return(importance)
  } else {
      importance <- fit$importance()
      message("Embedded variable importance method used.")
      return(importance)
  }
   --- R stacktrace ---
  where 1: vividImportance.Learner(data = data, fit = fit, response = response, 
      importanceType = importanceType, predictFun = pFun)
  where 2: vividImportance(data = data, fit = fit, response = response, 
      importanceType = importanceType, predictFun = pFun)
  where 3 at test_plots.R#17: vivi(fit = aq_fit, data = aq, response = "Ozone", gridSize = 5)
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame(), reporter = reporter)
  where 15 at test_plots.R#10: test_that("Test heatmap and network", {
      aq_Task <- TaskRegr$new(id = "airQ", backend = aq, target = "Ozone")
      aq_lrn <- lrn("regr.ranger", importance = "permutation")
      aq_fit <- aq_lrn$train(aq_Task)
      vi <- vivi(fit = aq_fit, data = aq, response = "Ozone", gridSize = 5)
      viH <- viviHeatmap(vi)
      expect_type(viH, "list")
      viH1 <- viviHeatmap(vi, angle = 45)
      expect_type(viH1, "list")
      viH2 <- viviHeatmap(vi, intPal = rev(colorspace::sequential_hcl(palette = "Purples 3", 
          n = 100)), impPal = rev(colorspace::sequential_hcl(palette = "Inferno", 
          n = 100)))
      expect_type(viH2, "list")
      viH3 <- viviHeatmap(vi, intLims = c(0, 2), impLims = c(0, 
          20))
      expect_type(viH3, "list")
      viN <- viviNetwork(vi)
      expect_type(viN, "list")
      viN1 <- viviNetwork(vi, intThreshold = 1)
      expect_type(viN1, "list")
      viN2 <- viviNetwork(vi, intThreshold = 1, removeNode = TRUE)
      expect_type(viN2, "list")
      viN3 <- viviNetwork(vi, intLims = c(0, 2), impLims = c(1, 
          20))
      expect_type(viN3, "list")
      viN4 <- viviNetwork(vi, layout = igraph::layout_as_star)
      expect_type(viN4, "list")
      viN5 <- viviNetwork(vi, cluster = igraph::cluster_infomap)
      expect_type(viN5, "list")
      viN6 <- viviNetwork(vi, cluster = c(1, 1, 2, 2, 2))
      expect_type(viN6, "list")
      viN7 <- viviNetwork(vi, nudge_x = 0.01, nudge_y = 0.01)
      expect_type(viN7, "list")
      viN8 <- viviNetwork(vi, intPal = rev(colorspace::sequential_hcl(palette = "Purples 3", 
          n = 100)), impPal = rev(colorspace::sequential_hcl(palette = "Inferno", 
          n = 100)))
      expect_type(viN8, "list")
      viN9 <- viviNetwork(vi, layout = cbind(c(1, 1, 1, 2, 2), 
          c(1, 2, 3, 1, 2)), intThreshold = 1, removeNode = T)
      expect_type(viN9, "list")
  })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, child_env(env), wrap = wrap)
  where 28: FUN(X[[i]], ...)
  where 29: lapply(test_paths, test_one_file, env = env, wrap = wrap)
  where 30: doTryCatch(return(expr), name, parentenv, handler)
  where 31: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 32: tryCatchList(expr, classes, parentenv, handlers)
  where 33: tryCatch(code, testthat_abort_reporter = function(cnd) {
      cat(conditionMessage(cnd), "\n")
      NULL
  })
  where 34: with_reporter(reporters$multi, lapply(test_paths, test_one_file, 
      env = env, wrap = wrap))
  where 35: test_files(test_dir = test_dir, test_package = test_package, 
      test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, 
      env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap, load_package = load_package)
  where 36: test_files(test_dir = path, test_paths = test_paths, test_package = package, 
      reporter = reporter, load_helpers = load_helpers, env = env, 
      stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap, load_package = load_package, parallel = parallel)
  where 37: test_dir("testthat", package = package, reporter = reporter, 
      ..., load_package = "installed")
  where 38: test_check("vivid")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (fit, data, response = NULL, importanceType = NULL, 
      predictFun = NULL) 
  {
      if (fit$packages == "ranger" && fit$model$importance.mode == 
          "none") {
          message("No variable importance mode selected.")
          vividImportance.default(fit, data, response, importanceType, 
              predictFun = predictFun)
      }
      else {
          featureNames <- names(data[, !(names(data) %in% response)])
          lrnID <- fit$properties
          if (length(lrnID) == 0) {
              message("No variable importance mode available.")
              vividImportance.default(fit, data, response, importanceType, 
                  predictFun = predictFun)
          }
          else if (fit$packages == "xgboost") {
              importance <- fit$importance()
              message("Embedded variable importance method used.")
              impNames <- names(importance)
              differernceNames <- setdiff(featureNames, impNames)
              importance <- c(importance, setNames(0, differernceNames))
              return(importance)
          }
          else {
              importance <- fit$importance()
              message("Embedded variable importance method used.")
              return(importance)
          }
      }
  }
  <bytecode: 0x5e6fae0>
  <environment: namespace:vivid>
   --- function search by body ---
  Function vividImportance.Learner in namespace vivid has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  No variable importance mode available.
  Agnostic variable importance method used.
  Calculating interactions...
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  Generating ice/pdp fits... waiting...
  Finished ice/pdp
  No variable importance mode available.
  Agnostic variable importance method used.
  Calculating interactions...
  ── Attaching packages ────────────────────────────────────── tidymodels 0.1.4 ──
  ✔ broom        0.7.10     ✔ rsample      0.1.1 
  ✔ dials        0.0.10     ✔ tibble       3.1.6 
  ✔ ggplot2      3.3.5      ✔ tidyr        1.1.4 
  ✔ infer        1.0.0      ✔ tune         0.1.6 
  ✔ modeldata    0.1.1      ✔ workflows    0.2.4 
  ✔ parsnip      0.1.7      ✔ workflowsets 0.1.0 
  ✔ purrr        0.3.4      ✔ yardstick    0.0.8 
  ✔ recipes      0.1.17     
  ── Conflicts ───────────────────────────────────────── tidymodels_conflicts() ──
  ✖ purrr::discard()        masks scales::discard()
  ✖ dplyr::filter()         masks stats::filter()
  ✖ purrr::is_null()        masks testthat::is_null()
  ✖ dplyr::lag()            masks stats::lag()
  ✖ tidyr::matches()        masks rsample::matches(), dplyr::matches(), testthat::matches()
  ✖ rsample::permutations() masks e1071::permutations()
  ✖ recipes::step()         masks stats::step()
  ✖ tune::tune()            masks e1071::tune()
  • Learn how to get started at https://www.tidymodels.org/start/
  randomForest 4.6-14
  Type rfNews() to see new features/changes/bug fixes.
  
  Attaching package: 'randomForest'
  
  The following object is masked from 'package:ggplot2':
  
      margin
  
  The following object is masked from 'package:dplyr':
  
      combine
  
  The following object is masked from 'package:ranger':
  
      importance
  
  
  Attaching package: 'MASS'
  
  The following object is masked from 'package:dplyr':
  
      select
  
  Loading required package: ParamHelpers
  Warning message: 'mlr' is in 'maintenance-only' mode since July 2019.
  Future development will only happen in 'mlr3'
  (<https://mlr3.mlr-org.com>). Due to the focus on 'mlr3' there might be
  uncaught bugs meanwhile in {mlr} - please consider switching.
  
  Attaching package: 'mlr'
  
  The following object is masked from 'package:e1071':
  
      impute
  
  The following objects are masked from 'package:mlr3':
  
      benchmark, resample
  
  No variable importance mode available.
  Agnostic variable importance method used.
  Calculating interactions...
  No variable importance mode available.
  Agnostic variable importance method used.
  Calculating interactions...
  Agnostic variable importance method used.
  Calculating interactions...
  No variable importance mode available.
  Agnostic variable importance method used.
  Calculating interactions...
  Embedded impurity variable importance method used.
  Calculating interactions...
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  Embedded impurity variable importance method used.
  Calculating interactions...
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  logits not available, as probabilites are not available.
  Agnostic variable importance method used.
  Calculating interactions...
  %IncMSE variable importance method used.
  Calculating interactions...
  IncNodePurity variable importance method used.
  Calculating interactions...
  No importanceType selected. Returning %IncMSE importance values
  Calculating interactions...
  No importanceType selected. Returning IncNodePurity importance values
  Calculating interactions...
  IncNodePurity importance selected.
  Calculating interactions...
  %IncMSE importance selected.
  Calculating interactions...
  No importanceType selected. Returning IncNodePurity importance values
  Calculating interactions...
  Agnostic variable importance method used.
  Flashlight importance works for numeric and numeric binary response only; setting importance to 1.
  Calculating interactions...
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test_plots.R:17:3): Test heatmap and network ─────────────────────────
  Error in `if (fit$packages == "xgboost") {
      importance <- fit$importance()
      message("Embedded variable importance method used.")
      impNames <- names(importance)
      differernceNames <- setdiff(featureNames, impNames)
      importance <- c(importance, setNames(0, differernceNames))
      return(importance)
  } else {
      importance <- fit$importance()
      message("Embedded variable importance method used.")
      return(importance)
  }`: the condition has length > 1
  Backtrace:
      █
   1. └─vivid::vivi(fit = aq_fit, data = aq, response = "Ozone", gridSize = 5) test_plots.R:17:2
   2.   ├─vivid:::vividImportance(...)
   3.   └─vivid:::vividImportance.Learner(...)
  
  [ FAIL 1 | WARN 0 | SKIP 0 | PASS 50 ]
  Error: Test failures
  Execution halted