Running ‘testthat.R’ [13s/17s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(utiml)
  Loading required package: mldr
  Loading required package: parallel
  Loading required package: ROCR
  Loading required package: gplots
  
  Attaching package: 'gplots'
  
  The following object is masked from 'package:stats':
  
      lowess
  
  > 
  > test_check("utiml")
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  utiml
   --- call from context --- 
  subset_correction(utiml_predict(predictions[object$labels], probability), 
      object$labelsets, probability)
   --- call from argument --- 
  if (class(train_y) == "mldr") {
      train_y <- train_y$dataset[train_y$labels$index]
  }
   --- R stacktrace ---
  where 1: subset_correction(utiml_predict(predictions[object$labels], probability), 
      object$labelsets, probability)
  where 2: predict.NSmodel(model, test)
  where 3 at testthat/test_brclassifiers.R#8: predict(model, test)
  where 4 at testthat/test_brclassifiers.R#29: predictionTest(model)
  where 5 at testthat/test_brclassifiers.R#187: baseTest(model, "NSmodel")
  where 6: eval(code, test_env)
  where 7: eval(code, test_env)
  where 8: 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 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 11: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 12: doTryCatch(return(expr), name, parentenv, handler)
  where 13: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 14: tryCatchList(expr, classes, parentenv, handlers)
  where 15: 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 16: test_code(desc, code, env = parent.frame())
  where 17 at testthat/test_brclassifiers.R#185: test_that("Nestest Stack", {
      model <- ns(train, "RANDOM")
      pred <- baseTest(model, "NSmodel")
      mpred <- as.matrix(pred)
      suppressWarnings(RNGversion("3.5.0"))
      set.seed(123)
      pred1 <- predict(model, test, prob = FALSE)
      expect_is(pred1, "mlresult")
      expect_equal(as.matrix(pred1), attr(pred, "classes"))
      expect_equal(as.matrix(pred), attr(pred1, "probs"))
      new.chain <- c("y5", "y4", "y3", "y2", "y1")
      model2 <- ns(train, "RANDOM", new.chain)
      expect_equal(model2$chain, new.chain)
      suppressWarnings(RNGversion("3.5.0"))
      set.seed(123)
      pred2 <- predict(model2, test)
      expect_equal(colnames(pred2), rownames(train$labels))
      suppressWarnings(RNGversion("3.5.0"))
      set.seed(123)
      pred3 <- predict(model2, test)
      expect_false(isTRUE(all.equal(pred3, pred1)))
      expect_equal(pred3, pred2)
      expect_error(ns(train, "RANDOM", chain = c("a", "b", "c", 
          "d", "e")))
      expect_error(ns(train, "RANDOM", chain = c(new.chain, "extra")))
  })
  where 18: eval(code, test_env)
  where 19: eval(code, test_env)
  where 20: 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 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 23: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 24: doTryCatch(return(expr), name, parentenv, handler)
  where 25: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 26: tryCatchList(expr, classes, parentenv, handlers)
  where 27: 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 28: test_code(NULL, exprs, env)
  where 29: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 30: force(code)
  where 31: doWithOneRestart(return(expr), restart)
  where 32: withOneRestart(expr, restarts[[1L]])
  where 33: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 34: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 35: FUN(X[[i]], ...)
  where 36: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 37: force(code)
  where 38: doWithOneRestart(return(expr), restart)
  where 39: withOneRestart(expr, restarts[[1L]])
  where 40: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 41: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 42: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 44: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 45: test_check("utiml")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (mlresult, train_y, probability = FALSE) 
  {
      bip <- as.bipartition(mlresult)
      prob <- as.probability(mlresult)
      if (class(train_y) == "mldr") {
          train_y <- train_y$dataset[train_y$labels$index]
      }
      if (ncol(mlresult) != ncol(train_y)) {
          stop("The number of columns in the predicted result are different from the\n         training data")
      }
      labelsets <- as.matrix(unique(train_y))
      rownames(labelsets) <- apply(labelsets, 1, paste, collapse = "")
      order <- names(sort(table(apply(train_y, 1, paste, collapse = "")), 
          decreasing = TRUE))
      labelsets <- labelsets[order, ]
      new.pred <- t(apply(bip, 1, function(y) {
          labelsets[names(which.min(apply(labelsets, 1, function(row) {
              sum(row != y)
          }))), ]
      }))
      multilabel_prediction(new.pred, prob, probability)
  }
  <bytecode: 0x559db2cacb10>
  <environment: namespace:utiml>
   --- function search by body ---
  Function subset_correction in namespace utiml has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1