Running 'testthat.R' [5s/5s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(mvtboost)
  > 
  > test_check("mvtboost")
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  mvtboost
   --- call from context --- 
  mvtb(Y = Y, X = X)
   --- call from argument --- 
  if (class(Y) != "matrix") {
      Y <- as.matrix(Y)
  }
   --- R stacktrace ---
  where 1 at testthat/test_covex.R#19: mvtb(Y = Y, X = X)
  where 2: eval(code, test_env)
  where 3: eval(code, test_env)
  where 4: 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 5: doTryCatch(return(expr), name, parentenv, handler)
  where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 7: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 10: tryCatchList(expr, classes, parentenv, handlers)
  where 11: 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 12: test_code(NULL, exprs, env)
  where 13: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 14: force(code)
  where 15: doWithOneRestart(return(expr), restart)
  where 16: withOneRestart(expr, restarts[[1L]])
  where 17: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 18: 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 19: FUN(X[[i]], ...)
  where 20: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 21: force(code)
  where 22: doWithOneRestart(return(expr), restart)
  where 23: withOneRestart(expr, restarts[[1L]])
  where 24: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 25: 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 26: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 27: 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 28: 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 29: test_check("mvtboost")
  
   --- value of length: 2 type: logical ---
  [1] FALSE  TRUE
   --- function from context --- 
  function (Y, X, n.trees = 100, shrinkage = 0.01, interaction.depth = 1, 
      distribution = "gaussian", train.fraction = 1, bag.fraction = 1, 
      cv.folds = 1, s = NULL, seednum = NULL, compress = FALSE, 
      save.cv = FALSE, iter.details = TRUE, verbose = FALSE, mc.cores = 1, 
      ...) 
  {
      if (class(Y) != "matrix") {
          Y <- as.matrix(Y)
      }
      if (is.null(ncol(X))) {
          X <- as.matrix(X)
      }
      params <- c(as.list(environment()), list(...))
      if (!is.null(seednum)) {
          set.seed(seednum)
      }
      stopifnot(nrow(X) == nrow(Y))
      n <- nrow(X)
      k <- ncol(Y)
      p <- ncol(X)
      if (is.null(colnames(X))) {
          colnames(X) <- paste("X", 1:p, sep = "")
      }
      if (is.null(colnames(Y))) {
          colnames(Y) <- paste("Y", 1:k, sep = "")
      }
      xnames <- colnames(X)
      ynames <- colnames(Y)
      if (is.null(s)) {
          s <- sample(1:n, floor(n * train.fraction), replace = F)
      }
      if (any(is.na(Y))) {
          stop("NAs not allowed in outcome variables.")
      }
      if (shrinkage > 1 | shrinkage <= 0) {
          stop("shrinkage should be > 0, < 1")
      }
      if (train.fraction > 1 | train.fraction <= 0) {
          stop("train.fraction should be > 0, < 1")
      }
      if (bag.fraction > 1 | bag.fraction <= 0) {
          stop("bag.fraction should be > 0, < 1")
      }
      trainerr <- testerr <- vector(length = n.trees)
      if (cv.folds > 1) {
          ocv <- mvtbCV(Y = Y, X = X, cv.folds = cv.folds, s = s, 
              save.cv = save.cv, mc.cores = mc.cores, n.trees = n.trees, 
              shrinkage = shrinkage, interaction.depth = interaction.depth, 
              distribution = distribution, bag.fraction = bag.fraction, 
              verbose = verbose, seednum = seednum)
          best.iters.cv <- ocv$best.iters.cv
          cv.err <- ocv$cv.err
          out.fit <- ocv$models.k[[cv.folds + 1]]
      }
      else {
          out.fit <- mvtb.fit(Y = Y, X = X, n.trees = n.trees, 
              shrinkage = shrinkage, interaction.depth = interaction.depth, 
              distribution = distribution, bag.fraction = bag.fraction, 
              verbose = verbose, s = s, seednum = seednum, ...)
          best.iters.cv <- NULL
          cv.err <- NULL
          ocv <- NULL
      }
      models <- out.fit$models
      trainerr <- out.fit$trainerr
      testerr <- out.fit$testerr
      best.trees <- list(best.testerr = which.min(testerr), best.cv = best.iters.cv, 
          last = n.trees)
      if (!save.cv) {
          ocv <- NULL
      }
      if (iter.details == T) {
          fl <- list(models = models, best.trees = best.trees, 
              params = params, trainerr = trainerr, testerr = testerr, 
              cv.err = cv.err, ocv = ocv, s = s, n = nrow(X), xnames = colnames(X), 
              ynames = colnames(Y))
      }
      else {
          fl <- list(models = models, best.trees = best.trees, 
              params = params, s = s, ocv = ocv, n = nrow(X), xnames = colnames(X), 
              ynames = colnames(Y))
      }
      if (compress) {
          fl <- lapply(fl, comp)
      }
      class(fl) <- "mvtb"
      return(fl)
  }
  <bytecode: 0xa684e90>
  <environment: namespace:mvtboost>
   --- function search by body ---
  Function mvtb in namespace mvtboost has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1