Running ‘testthat.R’ [2s/4s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(OpenImageR)
  > 
  > test_check("OpenImageR")
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  OpenImageR
   --- call from context --- 
  Augmentation(object_mat, crop_height = 10, crop_width = 10, resiz_width = 80, 
      resiz_height = 80, rotate_angle = 40)
   --- call from argument --- 
  if (!class(image) %in% c("data.frame", "matrix", "array", "list")) stop("the image parameter should be either a matrix, data frame, array or a list")
   --- R stacktrace ---
  where 1: Augmentation(object_mat, crop_height = 10, crop_width = 10, resiz_width = 80, 
      resiz_height = 80, rotate_angle = 40)
  where 2: eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  where 3: withCallingHandlers({
      code
      NULL
  }, error = function(cnd) {
      cnd <- cnd_entrace(cnd)
      return_from(env, cnd)
  })
  where 4: .capture(act$val <- eval_bare(quo_get_expr(.quo), quo_get_env(.quo)), 
      ...)
  where 5: quasi_capture(enquo(object), label, capture_error, entrace = TRUE)
  where 6 at testthat/test-augmentation.R#27: testthat::expect_error(Augmentation(object_mat, crop_height = 10, 
      crop_width = 10, resiz_width = 80, resiz_height = 80, rotate_angle = 40))
  where 7: eval(code, test_env)
  where 8: eval(code, test_env)
  where 9: 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 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 12: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 13: doTryCatch(return(expr), name, parentenv, handler)
  where 14: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 15: tryCatchList(expr, classes, parentenv, handlers)
  where 16: 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 17: test_code(desc, code, env = parent.frame())
  where 18 at testthat/test-augmentation.R#25: testthat::test_that("in case that crop_height, crop_width is not a sequence of values it returns an error", 
      {
          testthat::expect_error(Augmentation(object_mat, crop_height = 10, 
              crop_width = 10, resiz_width = 80, resiz_height = 80, 
              rotate_angle = 40))
      })
  where 19: eval(code, test_env)
  where 20: eval(code, test_env)
  where 21: 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 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 24: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 25: doTryCatch(return(expr), name, parentenv, handler)
  where 26: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 27: tryCatchList(expr, classes, parentenv, handlers)
  where 28: 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 29: test_code(NULL, exprs, env)
  where 30: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 31: force(code)
  where 32: doWithOneRestart(return(expr), restart)
  where 33: withOneRestart(expr, restarts[[1L]])
  where 34: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 35: 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 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: doWithOneRestart(return(expr), restart)
  where 40: withOneRestart(expr, restarts[[1L]])
  where 41: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 42: 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 43: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: 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 45: 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 46: test_check("OpenImageR")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (image, flip_mode = NULL, crop_width = NULL, crop_height = NULL, 
      resiz_width = 0, resiz_height = 0, resiz_method = "nearest", 
      shift_rows = 0, shift_cols = 0, rotate_angle = 0, rotate_method = "nearest", 
      zca_comps = 0, zca_epsilon = 0, image_thresh = 0, padded_value = 0, 
      verbose = FALSE) 
  {
      if (!class(image) %in% c("data.frame", "matrix", "array", 
          "list")) 
          stop("the image parameter should be either a matrix, data frame, array or a list")
      if ((length(crop_height) < 2 && !is.null(crop_height)) || 
          (length(crop_width) < 2 && !is.null(crop_width))) 
          stop("crop_height and crop_width should be a sequence of numeric values")
      if (length(resiz_width) != 1 || length(resiz_height) != 1) 
          stop("resiz_height and resiz_width should be a single value")
      if (!resiz_method %in% c("nearest", "bilinear")) 
          stop("valid resizing methods are 'nearest', 'bilinear'")
      if (rotate_angle > 360 || rotate_angle < 0) 
          stop("valid angles to rotate an image are values greater than 0 and less than 360")
      if (!rotate_method %in% c("nearest", "bilinear")) 
          stop("valid rotation methods are 'nearest', 'bilinear'")
      if (class(image) == "data.frame") 
          image = as.matrix(image)
      if (ncol(image) <= length(crop_height) && class(image) %in% 
          c("data.frame", "matrix", "array")) 
          stop("the length of the crop_height sequence should be less than the initial height of the image")
      if (nrow(image) <= length(crop_width) && class(image) %in% 
          c("data.frame", "matrix", "array")) 
          stop("the length of the crop_width sequence should be less than the initial width of the image")
      flag_comps = 0
      if (inherits(image, c("data.frame", "matrix", "array"))) {
          flag_comps = dim(image)[1] - 1
      }
      if (class(image) == "list") {
          flag_comps = dim(image[[1]])[1] - 1
      }
      if (!is.null(crop_width)) 
          flag_comps = length(crop_width)
      if (resiz_width != 0) 
          flag_comps = resiz_width
      if (zca_comps > flag_comps) 
          stop(paste("zca_comps should be greater or equal to 1 and less than or equal to", 
              flag_comps, sep = " "))
      if (is.null(crop_height)) 
          crop_height = numeric(0)
      if (is.null(crop_width)) 
          crop_width = numeric(0)
      if (!is.null(flip_mode) && !flip_mode %in% c("horizontal", 
          "vertical")) 
          stop("valid flip_mode is one of 'horizontal', 'vertical'")
      if (is.null(flip_mode)) 
          flip_mode = ""
      if (verbose) 
          start = Sys.time()
      if (class(image) == "matrix") {
          if (length(padded_value) != 1) {
              stop("the padded_value parameter should be a numeric value", 
                  call. = F)
          }
          out = augment_transf(image, flip_mode, crop_height, crop_width, 
              resiz_width, resiz_height, resiz_method, shift_rows, 
              shift_cols, rotate_angle, rotate_method, zca_comps, 
              zca_epsilon, image_thresh, padded_value)
      }
      if (class(image) == "array" && !is.na(dim(image)[3])) {
          if (length(padded_value) == 1) {
              padded_value = rep(padded_value, dim(image)[3])
          }
          else {
              if (length(padded_value) > 1 && length(padded_value) != 
                  dim(image)[3]) {
                  stop(paste0("the padded_value parameter should be a vector of length equal to ", 
                    dim(image)[3]), call. = F)
              }
          }
          out = augment_transf_array(image, flip_mode, crop_height, 
              crop_width, padded_value, resiz_width, resiz_height, 
              resiz_method, shift_rows, shift_cols, rotate_angle, 
              rotate_method, zca_comps, zca_epsilon, image_thresh)
      }
      if (class(image) == "list") {
          if (sum(unlist(lapply(image, function(x) class(x) == 
              "array" && dim(x)[3] == 3))) != length(image)) 
              stop("the list should consist of 3-dimensional arrays")
          if (sum(unlist(lapply(image, function(x) nrow(x) <= length(crop_width))))) 
              stop("the length of the crop_width sequence should be less than or equal to the initial width of each of the images")
          if (sum(unlist(lapply(image, function(x) ncol(x) <= length(crop_height))))) 
              stop("the length of the crop_height sequence should be less than or equal to the initial height of each of the images")
          if (length(padded_value) == 1) {
              padded_value = rep(padded_value, 3)
          }
          else {
              if (length(padded_value) > 1 && length(padded_value) != 
                  3) {
                  stop("the padded_value parameter should be a vector of length 3", 
                    call. = F)
              }
          }
          out = augment_array_list(image, flip_mode, crop_height, 
              crop_width, padded_value, resiz_width, resiz_height, 
              resiz_method, shift_rows, shift_cols, rotate_angle, 
              rotate_method, zca_comps, zca_epsilon, image_thresh)
      }
      if (verbose) {
          end = Sys.time()
          t = end - start
          cat("\n")
          cat("time to complete :", t, attributes(t)$units, "\n")
          cat("\n")
      }
      return(out)
  }
  <bytecode: 0x5614cd7a3388>
  <environment: namespace:OpenImageR>
   --- function search by body ---
  Function Augmentation in namespace OpenImageR has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1