Running 'testthat.R' [3s/4s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(clusternor)
  Loading required package: Rcpp
  > 
  > test_check("clusternor")
  
  
  ***Running test for fcmeans***
  
  Data ==> memory, centroids ==> memory
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  clusternor
   --- call from context --- 
  FuzzyCMeans(test_data, test_centroids, iter.max = iter.max, fuzz.index = 5, 
      nthread = nthread)
   --- call from argument --- 
  if (class(data) == "character") {
      if (class(centers) == "numeric" || class(centers) == "integer") {
          ret <- .Call("R_fcm_data_em", normalizePath(as.character(data)), 
              as.integer(centers), as.double(nrow), as.double(ncol), 
              as.double(iter.max), as.integer(nthread), as.integer(fuzz.index), 
              as.character(init), as.double(tolerance), as.character(dist.type), 
              PACKAGE = "clusternor")
      }
      else if (class(centers) == "matrix") {
          ret <- .Call("R_fcm_data_em_centroids_im", normalizePath(as.character(data)), 
              as.matrix(centers), as.double(nrow), as.double(ncol), 
              as.double(iter.max), as.integer(nthread), as.integer(fuzz.index), 
              as.double(tolerance), as.character(dist.type), PACKAGE = "clusternor")
      }
      else {
          stop(paste("Cannot handle centers of type", class(centers), 
              "\n"))
      }
  } else if (class(data) == "matrix") {
      if (class(centers) == "numeric" || class(centers) == "integer") {
          ret <- .Call("R_fcm_data_im", as.matrix(data), as.integer(centers), 
              as.double(iter.max), as.integer(nthread), as.integer(fuzz.index), 
              as.character(init), as.double(tolerance), as.character(dist.type), 
              PACKAGE = "clusternor")
      }
      else if (class(centers) == "matrix") {
          ret <- .Call("R_fcm_data_centroids_im", as.matrix(data), 
              as.matrix(centers), as.double(iter.max), as.integer(nthread), 
              as.integer(fuzz.index), as.double(tolerance), as.character(dist.type), 
              PACKAGE = "clusternor")
      }
      else {
          stop(paste("Cannot handle centers of type", class(centers), 
              "\n"))
      }
  } else {
      stop(paste("Cannot handle data of type", class(data), "\n"))
  }
   --- R stacktrace ---
  where 1 at testthat/test-fuzzy-cmeans.R#54: FuzzyCMeans(test_data, test_centroids, iter.max = iter.max, fuzz.index = 5, 
      nthread = nthread)
  where 2 at testthat/test-fuzzy-cmeans.R#62: test.data.centroids.in.mem()
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: 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 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: 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 13: test_code(NULL, exprs, env)
  where 14: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 15: force(code)
  where 16: doWithOneRestart(return(expr), restart)
  where 17: withOneRestart(expr, restarts[[1L]])
  where 18: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 19: 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 20: FUN(X[[i]], ...)
  where 21: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 22: force(code)
  where 23: doWithOneRestart(return(expr), restart)
  where 24: withOneRestart(expr, restarts[[1L]])
  where 25: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 26: 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 27: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 28: 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 29: 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 30: test_check("clusternor")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (data, centers, nrow = -1, ncol = -1, iter.max = .Machine$integer.max, 
      nthread = -1, fuzz.index = 2, init = c("forgy", "none"), 
      tolerance = 1e-06, dist.type = c("sqeucl", "eucl", "cos", 
          "taxi")) 
  {
      if (class(data) == "character") {
          if (class(centers) == "numeric" || class(centers) == 
              "integer") {
              ret <- .Call("R_fcm_data_em", normalizePath(as.character(data)), 
                  as.integer(centers), as.double(nrow), as.double(ncol), 
                  as.double(iter.max), as.integer(nthread), as.integer(fuzz.index), 
                  as.character(init), as.double(tolerance), as.character(dist.type), 
                  PACKAGE = "clusternor")
          }
          else if (class(centers) == "matrix") {
              ret <- .Call("R_fcm_data_em_centroids_im", normalizePath(as.character(data)), 
                  as.matrix(centers), as.double(nrow), as.double(ncol), 
                  as.double(iter.max), as.integer(nthread), as.integer(fuzz.index), 
                  as.double(tolerance), as.character(dist.type), 
                  PACKAGE = "clusternor")
          }
          else {
              stop(paste("Cannot handle centers of type", class(centers), 
                  "\n"))
          }
      }
      else if (class(data) == "matrix") {
          if (class(centers) == "numeric" || class(centers) == 
              "integer") {
              ret <- .Call("R_fcm_data_im", as.matrix(data), as.integer(centers), 
                  as.double(iter.max), as.integer(nthread), as.integer(fuzz.index), 
                  as.character(init), as.double(tolerance), as.character(dist.type), 
                  PACKAGE = "clusternor")
          }
          else if (class(centers) == "matrix") {
              ret <- .Call("R_fcm_data_centroids_im", as.matrix(data), 
                  as.matrix(centers), as.double(iter.max), as.integer(nthread), 
                  as.integer(fuzz.index), as.double(tolerance), 
                  as.character(dist.type), PACKAGE = "clusternor")
          }
          else {
              stop(paste("Cannot handle centers of type", class(centers), 
                  "\n"))
          }
      }
      else {
          stop(paste("Cannot handle data of type", class(data), 
              "\n"))
      }
  }
  <bytecode: 0x18bd348>
  <environment: namespace:clusternor>
   --- function search by body ---
  Function FuzzyCMeans in namespace clusternor has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 1. Error: (unknown) (@test-fuzzy-cmeans.R#62)  ------------------------------
  the condition has length > 1
  Backtrace:
   1. clusternor:::test.data.centroids.in.mem()
   2. clusternor::FuzzyCMeans(...)
  
  
  
  ***Running test for hmeans***
  
  Data ==>  ,centroids ==> memory
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  clusternor
   --- call from context --- 
  Hmeans(fn, kmax, nrow, ncol, iter.max = iter.max, init = test_centroids[1:2, 
      ], nthread = nthread)
   --- call from argument --- 
  if (class(init) == "character") {
      ret <- .Call("R_hmeans_data_em_init", as.character(data), 
          as.integer(kmax), as.double(nrow), as.double(ncol), as.double(iter.max), 
          as.integer(nthread), as.character(init), as.double(tolerance), 
          as.character(dist.type), as.integer(min.clust.size), 
          PACKAGE = "clusternor")
  } else if (class(init) == "matrix") {
      if (!(all(dim(init) == c(2, ncol), TRUE))) 
          stop("init centers must have dim: `c(2, ncol)'")
      ret <- .Call("R_hmeans_data_em_centers", as.character(data), 
          as.integer(kmax), as.double(nrow), as.double(ncol), as.double(iter.max), 
          as.integer(nthread), as.matrix(init), as.double(tolerance), 
          as.character(dist.type), as.integer(min.clust.size), 
          PACKAGE = "clusternor")
  } else {
      stop(paste("Cannot handle init of type", class(init), "\n"))
  }
   --- R stacktrace ---
  where 1: Hmeans(fn, kmax, nrow, ncol, iter.max = iter.max, init = test_centroids[1:2, 
      ], nthread = nthread)
  where 2 at testthat/test-hmeans.R#54: print(Hmeans(fn, kmax, nrow, ncol, iter.max = iter.max, init = test_centroids[1:2, 
      ], nthread = nthread))
  where 3 at testthat/test-hmeans.R#62: test.centroids.in.mem()
  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(NULL, exprs, env)
  where 15: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 16: force(code)
  where 17: doWithOneRestart(return(expr), restart)
  where 18: withOneRestart(expr, restarts[[1L]])
  where 19: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 20: 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 21: FUN(X[[i]], ...)
  where 22: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 23: force(code)
  where 24: doWithOneRestart(return(expr), restart)
  where 25: withOneRestart(expr, restarts[[1L]])
  where 26: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 27: 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 28: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 29: 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 30: 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 31: test_check("clusternor")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (data, kmax, nrow = -1, ncol = -1, iter.max = 20, nthread = -1, 
      init = c("forgy"), tolerance = 1e-06, dist.type = c("eucl", 
          "cos", "sqeucl", "taxi"), min.clust.size = 1) 
  {
      if (class(data) == "character") {
          if (class(init) == "character") {
              ret <- .Call("R_hmeans_data_em_init", as.character(data), 
                  as.integer(kmax), as.double(nrow), as.double(ncol), 
                  as.double(iter.max), as.integer(nthread), as.character(init), 
                  as.double(tolerance), as.character(dist.type), 
                  as.integer(min.clust.size), PACKAGE = "clusternor")
          }
          else if (class(init) == "matrix") {
              if (!(all(dim(init) == c(2, ncol), TRUE))) 
                  stop("init centers must have dim: `c(2, ncol)'")
              ret <- .Call("R_hmeans_data_em_centers", as.character(data), 
                  as.integer(kmax), as.double(nrow), as.double(ncol), 
                  as.double(iter.max), as.integer(nthread), as.matrix(init), 
                  as.double(tolerance), as.character(dist.type), 
                  as.integer(min.clust.size), PACKAGE = "clusternor")
          }
          else {
              stop(paste("Cannot handle init of type", class(init), 
                  "\n"))
          }
      }
      else if (class(data) == "matrix") {
          if (class(init) == "character") {
              ret <- .Call("R_hmeans_data_im_init", as.matrix(data), 
                  as.integer(kmax), as.double(iter.max), as.integer(nthread), 
                  as.character(init), as.double(tolerance), as.character(dist.type), 
                  as.integer(min.clust.size), PACKAGE = "clusternor")
          }
          else if (class(init) == "matrix") {
              if (!(all(dim(init) == c(2, dim(data)[2]), TRUE))) 
                  stop("init centers must have dim: `c(2, dim(data)[1])'")
              ret <- .Call("R_hmeans_data_im_centers", as.matrix(data), 
                  as.integer(kmax), as.double(iter.max), as.integer(nthread), 
                  as.matrix(init), as.double(tolerance), as.character(dist.type), 
                  as.integer(min.clust.size), PACKAGE = "clusternor")
          }
          else {
              stop(paste("Cannot handle init of type", class(init), 
                  "\n"))
          }
      }
  }
  <bytecode: 0x18c7c40>
  <environment: namespace:clusternor>
   --- function search by body ---
  Function Hmeans in namespace clusternor has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 2. Error: (unknown) (@test-hmeans.R#62)  ------------------------------------
  the condition has length > 1
  Backtrace:
   1. clusternor:::test.centroids.in.mem()
   3. clusternor::Hmeans(...)
  
  
  
  ***Running test for kmeanspp***
  
  Data ==> memory, centroids ==> compute
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  clusternor
   --- call from context --- 
  KmeansPP(test_data, k, nrow, ncol, nstart = 10, nthread = nthread)
   --- call from argument --- 
  if (class(data) == "matrix") {
      if (class(centers) == "numeric" || class(centers) == "integer") {
          ret <- .Call("R_kmeanspp_data_im", as.matrix(data), as.integer(centers), 
              as.integer(nstart), as.integer(nthread), as.character(dist.type), 
              PACKAGE = "clusternor")
          ret$iters <- NULL
          ret
      }
      else {
          stop(paste("Cannot handle centers of type", class(centers), 
              "\n"))
      }
  } else if (class(data) == "character") {
      if (class(centers) == "numeric" || class(centers) == "integer") {
          ret <- .Call("R_kmeanspp_data_em", normalizePath(as.character(data)), 
              as.integer(centers), as.double(nrow), as.double(ncol), 
              as.integer(nstart), as.integer(nthread), as.character(dist.type), 
              PACKAGE = "clusternor")
          ret$iters <- NULL
          ret
      }
      else {
          stop(paste("Cannot handle centers of type", class(centers), 
              "\n"))
      }
  } else {
      stop(paste("Cannot handle data of type", class(data), "\n"))
  }
   --- R stacktrace ---
  where 1: KmeansPP(test_data, k, nrow, ncol, nstart = 10, nthread = nthread)
  where 2 at testthat/test-kmeanspp.R#32: print(KmeansPP(test_data, k, nrow, ncol, nstart = 10, nthread = nthread))
  where 3 at testthat/test-kmeanspp.R#44: test.data.in.mem()
  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(NULL, exprs, env)
  where 15: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 16: force(code)
  where 17: doWithOneRestart(return(expr), restart)
  where 18: withOneRestart(expr, restarts[[1L]])
  where 19: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 20: 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 21: FUN(X[[i]], ...)
  where 22: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 23: force(code)
  where 24: doWithOneRestart(return(expr), restart)
  where 25: withOneRestart(expr, restarts[[1L]])
  where 26: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 27: 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 28: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 29: 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 30: 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 31: test_check("clusternor")
  
   --- value of length: 2 type: logical ---
  [1]  TRUE FALSE
   --- function from context --- 
  function (data, centers, nrow = -1, ncol = -1, nstart = 1, nthread = -1, 
      dist.type = c("sqeucl", "eucl", "cos", "taxi")) 
  {
      if (class(data) == "matrix") {
          if (class(centers) == "numeric" || class(centers) == 
              "integer") {
              ret <- .Call("R_kmeanspp_data_im", as.matrix(data), 
                  as.integer(centers), as.integer(nstart), as.integer(nthread), 
                  as.character(dist.type), PACKAGE = "clusternor")
              ret$iters <- NULL
              ret
          }
          else {
              stop(paste("Cannot handle centers of type", class(centers), 
                  "\n"))
          }
      }
      else if (class(data) == "character") {
          if (class(centers) == "numeric" || class(centers) == 
              "integer") {
              ret <- .Call("R_kmeanspp_data_em", normalizePath(as.character(data)), 
                  as.integer(centers), as.double(nrow), as.double(ncol), 
                  as.integer(nstart), as.integer(nthread), as.character(dist.type), 
                  PACKAGE = "clusternor")
              ret$iters <- NULL
              ret
          }
          else {
              stop(paste("Cannot handle centers of type", class(centers), 
                  "\n"))
          }
      }
      else {
          stop(paste("Cannot handle data of type", class(data), 
              "\n"))
      }
  }
  <bytecode: 0x181aa00>
  <environment: namespace:clusternor>
   --- function search by body ---
  Function KmeansPP in namespace clusternor has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 3. Error: (unknown) (@test-kmeanspp.R#44)  ----------------------------------
  the condition has length > 1
  Backtrace:
   1. clusternor:::test.data.in.mem()
   3. clusternor::KmeansPP(test_data, k, nrow, ncol, nstart = 10, nthread = nthread)
  
  
  
  ***Running test for knori***
  
  Data ==> memory, centroids ==> compute
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  clusternor
   --- call from context --- 
  Kmeans(test_data, k, nrow, ncol, nthread = nthread)
   --- call from argument --- 
  if (class(data) == "character") {
      if (class(centers) == "numeric" || class(centers) == "integer") {
          ret <- .Call("R_kmeans", normalizePath(as.character(data)), 
              as.integer(centers), as.double(nrow), as.double(ncol), 
              as.double(iter.max), as.integer(nthread), as.character(init), 
              as.double(tolerance), as.character(dist.type), PACKAGE = "clusternor")
      }
      else if (class(centers) == "matrix") {
          ret <- .Call("R_kmeans_centroids_im", normalizePath(as.character(data)), 
              as.matrix(centers), as.double(nrow), as.double(iter.max), 
              as.integer(nthread), as.double(tolerance), as.character(dist.type), 
              PACKAGE = "clusternor")
      }
      else if (class(centers) == "list") {
          ret <- .Call("R_kmeans_data_centroids_em", normalizePath(as.character(data)), 
              normalizePath(as.character(centers[1])), as.integer(centers[2]), 
              as.double(nrow), as.double(ncol), as.double(iter.max), 
              as.integer(nthread), as.double(tolerance), as.character(dist.type), 
              PACKAGE = "clusternor")
      }
      else {
          stop(paste("Cannot handle centers of type", class(centers), 
              "\n"))
      }
  } else if (class(data) == "matrix") {
      if (class(centers) == "numeric" || class(centers) == "integer") {
          ret <- .Call("R_kmeans_data_im", as.matrix(data), as.integer(centers), 
              as.double(iter.max), as.integer(nthread), as.character(init), 
              as.double(tolerance), as.character(dist.type), PACKAGE = "clusternor")
      }
      else if (class(centers) == "matrix") {
          ret <- .Call("R_kmeans_data_centroids_im", as.matrix(data), 
              as.matrix(centers), as.double(iter.max), as.integer(nthread), 
              as.double(tolerance), as.character(dist.type), PACKAGE = "clusternor")
      }
      else if (class(centers) == "character") {
          ret <- .Call("R_kmeans_data_im_centroids_em", as.matrix(data), 
              normalizePath(centers), as.double(iter.max), as.integer(nthread), 
              as.double(tolerance), as.character(dist.type), PACKAGE = "clusternor")
      }
      else {
          stop(paste("Cannot handle centers of type", class(centers), 
              "\n"))
      }
  } else {
      stop(paste("Cannot handle data of type", class(data), "\n"))
  }
   --- R stacktrace ---
  where 1: Kmeans(test_data, k, nrow, ncol, nthread = nthread)
  where 2 at testthat/test-knori.R#32: print(Kmeans(test_data, k, nrow, ncol, nthread = nthread))
  where 3 at testthat/test-knori.R#68: test.data.in.mem()
  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(NULL, exprs, env)
  where 15: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 16: force(code)
  where 17: doWithOneRestart(return(expr), restart)
  where 18: withOneRestart(expr, restarts[[1L]])
  where 19: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 20: 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 21: FUN(X[[i]], ...)
  where 22: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 23: force(code)
  where 24: doWithOneRestart(return(expr), restart)
  where 25: withOneRestart(expr, restarts[[1L]])
  where 26: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 27: 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 28: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 29: 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 30: 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 31: test_check("clusternor")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (data, centers, nrow = -1, ncol = -1, iter.max = .Machine$integer.max, 
      nthread = -1, init = c("kmeanspp", "random", "forgy", "none"), 
      tolerance = 1e-06, dist.type = c("eucl", "sqeucl", "cos", 
          "taxi")) 
  {
      if (class(data) == "character") {
          if (class(centers) == "numeric" || class(centers) == 
              "integer") {
              ret <- .Call("R_kmeans", normalizePath(as.character(data)), 
                  as.integer(centers), as.double(nrow), as.double(ncol), 
                  as.double(iter.max), as.integer(nthread), as.character(init), 
                  as.double(tolerance), as.character(dist.type), 
                  PACKAGE = "clusternor")
          }
          else if (class(centers) == "matrix") {
              ret <- .Call("R_kmeans_centroids_im", normalizePath(as.character(data)), 
                  as.matrix(centers), as.double(nrow), as.double(iter.max), 
                  as.integer(nthread), as.double(tolerance), as.character(dist.type), 
                  PACKAGE = "clusternor")
          }
          else if (class(centers) == "list") {
              ret <- .Call("R_kmeans_data_centroids_em", normalizePath(as.character(data)), 
                  normalizePath(as.character(centers[1])), as.integer(centers[2]), 
                  as.double(nrow), as.double(ncol), as.double(iter.max), 
                  as.integer(nthread), as.double(tolerance), as.character(dist.type), 
                  PACKAGE = "clusternor")
          }
          else {
              stop(paste("Cannot handle centers of type", class(centers), 
                  "\n"))
          }
      }
      else if (class(data) == "matrix") {
          if (class(centers) == "numeric" || class(centers) == 
              "integer") {
              ret <- .Call("R_kmeans_data_im", as.matrix(data), 
                  as.integer(centers), as.double(iter.max), as.integer(nthread), 
                  as.character(init), as.double(tolerance), as.character(dist.type), 
                  PACKAGE = "clusternor")
          }
          else if (class(centers) == "matrix") {
              ret <- .Call("R_kmeans_data_centroids_im", as.matrix(data), 
                  as.matrix(centers), as.double(iter.max), as.integer(nthread), 
                  as.double(tolerance), as.character(dist.type), 
                  PACKAGE = "clusternor")
          }
          else if (class(centers) == "character") {
              ret <- .Call("R_kmeans_data_im_centroids_em", as.matrix(data), 
                  normalizePath(centers), as.double(iter.max), 
                  as.integer(nthread), as.double(tolerance), as.character(dist.type), 
                  PACKAGE = "clusternor")
          }
          else {
              stop(paste("Cannot handle centers of type", class(centers), 
                  "\n"))
          }
      }
      else {
          stop(paste("Cannot handle data of type", class(data), 
              "\n"))
      }
  }
  <bytecode: 0x18b8180>
  <environment: namespace:clusternor>
   --- function search by body ---
  Function Kmeans in namespace clusternor has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 4. Error: (unknown) (@test-knori.R#68)  -------------------------------------
  the condition has length > 1
  Backtrace:
   1. clusternor:::test.data.in.mem()
   3. clusternor::Kmeans(test_data, k, nrow, ncol, nthread = nthread)
  
  
  
  ***Running test for kmeans***
  
  Data ==> disk, centroids ==> memory
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  clusternor
   --- call from context --- 
  MiniBatchKmeans(fn, test_centroids, nrow, iter.max = iter.max, 
      batch.size, nthread = nthread)
   --- call from argument --- 
  if (class(centers) == "matrix") {
      ret <- .Call("R_mbkmeans_centroids_im", normalizePath(as.character(data)), 
          as.matrix(centers), as.double(nrow), as.integer(batch.size), 
          as.double(iter.max), as.integer(nthread), as.double(tolerance), 
          as.character(dist.type), PACKAGE = "clusternor")
  } else {
      stop(paste("Cannot handle centers of type", class(centers), 
          "\n"))
  }
   --- R stacktrace ---
  where 1: MiniBatchKmeans(fn, test_centroids, nrow, iter.max = iter.max, 
      batch.size, nthread = nthread)
  where 2 at testthat/test-mb-kmeans.R#48: print(MiniBatchKmeans(fn, test_centroids, nrow, iter.max = iter.max, 
      batch.size, nthread = nthread))
  where 3 at testthat/test-mb-kmeans.R#62: test.centroids.in.mem()
  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(NULL, exprs, env)
  where 15: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 16: force(code)
  where 17: doWithOneRestart(return(expr), restart)
  where 18: withOneRestart(expr, restarts[[1L]])
  where 19: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 20: 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 21: FUN(X[[i]], ...)
  where 22: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 23: force(code)
  where 24: doWithOneRestart(return(expr), restart)
  where 25: withOneRestart(expr, restarts[[1L]])
  where 26: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 27: 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 28: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 29: 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 30: 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 31: test_check("clusternor")
  
   --- value of length: 2 type: logical ---
  [1]  TRUE FALSE
   --- function from context --- 
  function (data, centers, nrow = -1, ncol = -1, batch.size = 100, 
      iter.max = .Machine$integer.max, nthread = -1, init = c("kmeanspp", 
          "random", "forgy", "none"), tolerance = 0.01, dist.type = c("sqeucl", 
          "eucl", "cos", "taxi"), max.no.improvement = 3) 
  {
      if (class(data) == "character") {
          if (class(centers) == "numeric" || class(centers) == 
              "integer") {
              ret <- .Call("R_mbkmeans", normalizePath(as.character(data)), 
                  as.integer(centers), as.double(nrow), as.double(ncol), 
                  as.integer(batch.size), as.double(iter.max), 
                  as.integer(nthread), as.character(init), as.double(tolerance), 
                  as.character(dist.type), PACKAGE = "clusternor")
          }
          else if (class(centers) == "matrix") {
              ret <- .Call("R_mbkmeans_centroids_im", normalizePath(as.character(data)), 
                  as.matrix(centers), as.double(nrow), as.integer(batch.size), 
                  as.double(iter.max), as.integer(nthread), as.double(tolerance), 
                  as.character(dist.type), PACKAGE = "clusternor")
          }
          else {
              stop(paste("Cannot handle centers of type", class(centers), 
                  "\n"))
          }
      }
      else if (class(data) == "matrix") {
          if (class(centers) == "numeric" || class(centers) == 
              "integer") {
              ret <- .Call("R_mbkmeans_data_im", as.matrix(data), 
                  as.integer(centers), as.integer(batch.size), 
                  as.double(iter.max), as.integer(nthread), as.character(init), 
                  as.double(tolerance), as.character(dist.type), 
                  PACKAGE = "clusternor")
          }
          else if (class(centers) == "matrix") {
              ret <- .Call("R_mbkmeans_data_centroids_im", as.matrix(data), 
                  as.matrix(centers), as.integer(batch.size), as.double(iter.max), 
                  as.integer(nthread), as.double(tolerance), as.character(dist.type), 
                  PACKAGE = "clusternor")
          }
          else {
              stop(paste("Cannot handle centers of type", class(centers), 
                  "\n"))
          }
      }
      else {
          stop(paste("Cannot handle data of type", class(data), 
              "\n"))
      }
  }
  <bytecode: 0x188ce68>
  <environment: namespace:clusternor>
   --- function search by body ---
  Function MiniBatchKmeans in namespace clusternor has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 5. Error: (unknown) (@test-mb-kmeans.R#62)  ---------------------------------
  the condition has length > 1
  Backtrace:
   1. clusternor:::test.centroids.in.mem()
   3. clusternor::MiniBatchKmeans(...)
  
  
  
  ***Running test for skmeans***
  
  Data ==> disk, centroids ==> memory
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  clusternor
   --- call from context --- 
  Skmeans(fn, test_centroids, nrow, ncol, nthread = nthread)
   --- call from argument --- 
  if (class(centers) == "matrix") {
      ret <- .Call("R_skmeans_centroids_im", normalizePath(as.character(data)), 
          as.matrix(centers), as.double(nrow), as.double(iter.max), 
          as.integer(nthread), as.double(tolerance), PACKAGE = "clusternor")
  }
   --- R stacktrace ---
  where 1: Skmeans(fn, test_centroids, nrow, ncol, nthread = nthread)
  where 2 at testthat/test-skmeans.R#44: print(Skmeans(fn, test_centroids, nrow, ncol, nthread = nthread))
  where 3 at testthat/test-skmeans.R#55: test.centroids.in.mem()
  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(NULL, exprs, env)
  where 15: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 16: force(code)
  where 17: doWithOneRestart(return(expr), restart)
  where 18: withOneRestart(expr, restarts[[1L]])
  where 19: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 20: 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 21: FUN(X[[i]], ...)
  where 22: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 23: force(code)
  where 24: doWithOneRestart(return(expr), restart)
  where 25: withOneRestart(expr, restarts[[1L]])
  where 26: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 27: 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 28: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 29: 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 30: 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 31: test_check("clusternor")
  
   --- value of length: 2 type: logical ---
  [1]  TRUE FALSE
   --- function from context --- 
  function (data, centers, nrow = -1, ncol = -1, iter.max = .Machine$integer.max, 
      nthread = -1, init = c("kmeanspp", "random", "forgy", "none"), 
      tolerance = 1e-06) 
  {
      if (class(data) == "matrix") {
          if (class(centers) == "numeric" || class(centers) == 
              "integer") {
              ret <- .Call("R_skmeans_data_im", as.matrix(data), 
                  as.integer(centers), as.double(iter.max), as.integer(nthread), 
                  as.character(init), as.double(tolerance), PACKAGE = "clusternor")
          }
          else if (class(centers) == "matrix") {
              ret <- .Call("R_skmeans_data_centroids_im", as.matrix(data), 
                  as.matrix(centers), as.double(iter.max), as.integer(nthread), 
                  as.double(tolerance), PACKAGE = "clusternor")
          }
          else {
              stop(paste("Cannot handle centers of type", class(centers), 
                  "\n"))
          }
      }
      else if (class(data) == "character") {
          if (class(centers) == "numeric" || class(centers) == 
              "integer") {
              ret <- .Call("R_skmeans_data_em", normalizePath(as.character(data)), 
                  as.integer(centers), as.double(nrow), as.double(ncol), 
                  as.double(iter.max), as.integer(nthread), as.character(init), 
                  as.double(tolerance), PACKAGE = "clusternor")
          }
          else if (class(centers) == "matrix") {
              ret <- .Call("R_skmeans_centroids_im", normalizePath(as.character(data)), 
                  as.matrix(centers), as.double(nrow), as.double(iter.max), 
                  as.integer(nthread), as.double(tolerance), PACKAGE = "clusternor")
          }
      }
      else {
          stop(paste("Cannot handle data of type", class(data), 
              "\n"))
      }
  }
  <bytecode: 0x1889648>
  <environment: namespace:clusternor>
   --- function search by body ---
  Function Skmeans in namespace clusternor has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 6. Error: (unknown) (@test-skmeans.R#55)  -----------------------------------
  the condition has length > 1
  Backtrace:
   1. clusternor:::test.centroids.in.mem()
   3. clusternor::Skmeans(fn, test_centroids, nrow, ncol, nthread = nthread)
  
  
  
  ***Running test for xmeans***
  
  Data ==> disk, centroids ==> memory
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  clusternor
   --- call from context --- 
  Xmeans(fn, kmax, nrow, ncol, iter.max = iter.max, init = test_centroids[1:2, 
      ], nthread = nthread)
   --- call from argument --- 
  if (class(init) == "character") {
      ret <- .Call("R_xmeans_data_em_init", as.character(data), 
          as.integer(kmax), as.double(nrow), as.double(ncol), as.double(iter.max), 
          as.integer(nthread), as.character(init), as.double(tolerance), 
          as.character(dist.type), as.integer(min.clust.size), 
          PACKAGE = "clusternor")
  } else if (class(init) == "matrix") {
      if (!(all(dim(init) == c(2, ncol), TRUE))) 
          stop("init centers must have dim: `c(2, ncol)'")
      ret <- .Call("R_xmeans_data_em_centers", as.character(data), 
          as.integer(kmax), as.double(nrow), as.double(ncol), as.double(iter.max), 
          as.integer(nthread), as.matrix(init), as.double(tolerance), 
          as.character(dist.type), as.integer(min.clust.size), 
          PACKAGE = "clusternor")
  } else {
      stop(paste("Cannot handle init of type", class(init), "\n"))
  }
   --- R stacktrace ---
  where 1: Xmeans(fn, kmax, nrow, ncol, iter.max = iter.max, init = test_centroids[1:2, 
      ], nthread = nthread)
  where 2 at testthat/test-xmeans.R#55: print(Xmeans(fn, kmax, nrow, ncol, iter.max = iter.max, init = test_centroids[1:2, 
      ], nthread = nthread))
  where 3 at testthat/test-xmeans.R#62: test.centroids.in.mem()
  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(NULL, exprs, env)
  where 15: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 16: force(code)
  where 17: doWithOneRestart(return(expr), restart)
  where 18: withOneRestart(expr, restarts[[1L]])
  where 19: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 20: 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 21: FUN(X[[i]], ...)
  where 22: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 23: force(code)
  where 24: doWithOneRestart(return(expr), restart)
  where 25: withOneRestart(expr, restarts[[1L]])
  where 26: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 27: 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 28: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 29: 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 30: 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 31: test_check("clusternor")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (data, kmax, nrow = -1, ncol = -1, iter.max = 20, nthread = -1, 
      init = c("forgy"), tolerance = 1e-06, dist.type = c("eucl", 
          "cos", "taxi"), min.clust.size = 1) 
  {
      if (class(data) == "character") {
          if (class(init) == "character") {
              ret <- .Call("R_xmeans_data_em_init", as.character(data), 
                  as.integer(kmax), as.double(nrow), as.double(ncol), 
                  as.double(iter.max), as.integer(nthread), as.character(init), 
                  as.double(tolerance), as.character(dist.type), 
                  as.integer(min.clust.size), PACKAGE = "clusternor")
          }
          else if (class(init) == "matrix") {
              if (!(all(dim(init) == c(2, ncol), TRUE))) 
                  stop("init centers must have dim: `c(2, ncol)'")
              ret <- .Call("R_xmeans_data_em_centers", as.character(data), 
                  as.integer(kmax), as.double(nrow), as.double(ncol), 
                  as.double(iter.max), as.integer(nthread), as.matrix(init), 
                  as.double(tolerance), as.character(dist.type), 
                  as.integer(min.clust.size), PACKAGE = "clusternor")
          }
          else {
              stop(paste("Cannot handle init of type", class(init), 
                  "\n"))
          }
      }
      else if (class(data) == "matrix") {
          if (class(init) == "character") {
              ret <- .Call("R_xmeans_data_im_init", as.matrix(data), 
                  as.integer(kmax), as.double(iter.max), as.integer(nthread), 
                  as.character(init), as.double(tolerance), as.character(dist.type), 
                  as.integer(min.clust.size), PACKAGE = "clusternor")
          }
          else if (class(init) == "matrix") {
              if (!(all(dim(init) == c(2, dim(data)[2]), TRUE))) 
                  stop("init centers must have dim: `c(2, dim(data)[1])'")
              ret <- .Call("R_xmeans_data_im_centers", as.matrix(data), 
                  as.integer(kmax), as.double(iter.max), as.integer(nthread), 
                  as.matrix(init), as.double(tolerance), as.character(dist.type), 
                  as.integer(min.clust.size), PACKAGE = "clusternor")
          }
          else {
              stop(paste("Cannot handle init of type", class(init), 
                  "\n"))
          }
      }
  }
  <bytecode: 0x1986738>
  <environment: namespace:clusternor>
   --- function search by body ---
  Function Xmeans in namespace clusternor has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 7. Error: (unknown) (@test-xmeans.R#62)  ------------------------------------
  the condition has length > 1
  Backtrace:
   1. clusternor:::test.centroids.in.mem()
   3. clusternor::Xmeans(...)
  
  == testthat results  ===========================================================
  [ OK: 0 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 7 ]
  1. Error: (unknown) (@test-fuzzy-cmeans.R#62) 
  2. Error: (unknown) (@test-hmeans.R#62) 
  3. Error: (unknown) (@test-kmeanspp.R#44) 
  4. Error: (unknown) (@test-knori.R#68) 
  5. Error: (unknown) (@test-mb-kmeans.R#62) 
  6. Error: (unknown) (@test-skmeans.R#55) 
  7. Error: (unknown) (@test-xmeans.R#62) 
  
  Error: testthat unit tests failed
  Execution halted