Running ‘test-all.R’ [12s/16s]
Running the tests in ‘tests/test-all.R’ failed.
Complete output:
  > library(testthat)
  > library(eeptools)
  Loading required package: ggplot2
  > 
  > test_check("eeptools")
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  eeptools
   --- call from context --- 
  max_mis(ordered("A", "B", "C"))
   --- call from argument --- 
  if (varclass %in% c("ordered", "factor", "character")) {
      stop("Vector must be of class integer or real to take maximum values")
  }
   --- R stacktrace ---
  where 1: max_mis(ordered("A", "B", "C"))
  where 2: eval_bare(get_expr(quo), get_env(quo))
  where 3: doTryCatch(return(expr), name, parentenv, handler)
  where 4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 5: tryCatchList(expr, classes, parentenv, handlers)
  where 6: tryCatch({
      code
      NULL
  }, error = function(e) e)
  where 7: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  where 8: quasi_capture(enquo(object), capture_error, label = label)
  where 9 at testthat/test-utils.R#91: expect_error(max_mis(ordered("A", "B", "C")))
  where 10: eval(code, test_env)
  where 11: eval(code, test_env)
  where 12: 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 13: doTryCatch(return(expr), name, parentenv, handler)
  where 14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 15: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 16: doTryCatch(return(expr), name, parentenv, handler)
  where 17: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 18: tryCatchList(expr, classes, parentenv, handlers)
  where 19: 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 20: test_code(desc, code, env = parent.frame())
  where 21 at testthat/test-utils.R#83: test_that("max_mis handles missing data correctly", {
      expect_identical(max(c(7, NA, 3, 2, 0), na.rm = TRUE), max_mis(c(7, 
          NA, 3, 2, 0)))
      max(c(NA, NA, NA, NA), na.rm = TRUE)
      expect_identical(max_mis(c(NA, NA, NA, NA)), NA_real_)
      expect_identical(max_mis(c(NA_real_, NA_real_)), NA_real_)
      expect_identical(max_mis(c()), NA_real_)
      expect_error(max_mis(c("A", "B", "C")))
      expect_error(max_mis(factor("A", "B", "C")))
      expect_error(max_mis(ordered("A", "B", "C")))
  })
  where 22: eval(code, test_env)
  where 23: eval(code, test_env)
  where 24: 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 25: doTryCatch(return(expr), name, parentenv, handler)
  where 26: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 27: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 28: doTryCatch(return(expr), name, parentenv, handler)
  where 29: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 30: tryCatchList(expr, classes, parentenv, handlers)
  where 31: 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 32: test_code(NULL, exprs, env)
  where 33: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 34: force(code)
  where 35: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          end_context()
      })
  where 36: FUN(X[[i]], ...)
  where 37: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 38: force(code)
  where 39: 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 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: 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 42: 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 43: test_check("eeptools")
  
   --- value of length: 2 type: logical ---
  [1] TRUE TRUE
   --- function from context --- 
  function (x) 
  {
      varclass <- class(x)
      if (varclass %in% c("ordered", "factor", "character")) {
          stop("Vector must be of class integer or real to take maximum values")
      }
      suppressWarnings(x <- max(x, na.rm = TRUE))
      if (varclass == "integer") {
          ifelse(!is.finite(x), NA_integer_, x)
      }
      else if (varclass == "numeric") {
          ifelse(!is.finite(x), NA_real_, x)
      }
      else if (varclass %in% c("NULL", "logical")) {
          NA_real_
      }
  }
  <bytecode: 0x55e7ed0bf460>
  <environment: namespace:eeptools>
   --- function search by body ---
  Function max_mis in namespace eeptools has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1