Running ‘testthat.R’ [9s/23s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(ClusterR)
  Loading required package: gtools
  > 
  > test_check("ClusterR")
  1. Error: KMeans_rcpp returns the correct output for the initializers (@test-kmeans.R#323) 
  no function to return from, jumping to top level
  1: KMeans_rcpp(X, clusters = clust, num_init = 5, max_iters = 10, initializer = i, tol_optimal_init = 0.2) at testthat/test-kmeans.R:323
  2: KMEANS_rcpp(data, clusters, num_init, max_iters, initializer, fuzzy, threads, verbose, 
         CENTROIDS, tol, eps = 1e-06, tol_optimal_init, seed)
  3: tryCatch(evalq((function (x, ...) 
     UseMethod("quantile"))(structure(c(0, 0.001953125, 0.005859375, 0.01171875, 0.01953125, 
     0.03125, 0.048828125, 0.072265625, 0.09765625, 0.177734375, 0.259765625, 0.34375, 
     0.4296875, 0.517578125, 0.609375, 0.703125, 0.798828125, 0.8984375, 1), .Dim = c(1L, 
     19L)), 0), <environment>), error = function (x) 
     x, interrupt = function (x) 
     x)
  4: tryCatchList(expr, classes, parentenv, handlers)
  5: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], 
         parentenv, handlers[[nh]])
  6: doTryCatch(return(expr), name, parentenv, handler)
  7: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  9: simpleError(msg, call)
  10: structure(list(message = as.character(message), call = call), class = class)
  
  
   *** caught segfault ***
  address 8320c484, cause 'memory not mapped'
  
  Traceback:
   1: doTryCatch(return(expr), name, parentenv, handler)
   2: tryCatchOne(expr, names, parentenv, handlers[[1L]])
   3: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
   4: doTryCatch(return(expr), name, parentenv, handler)
   5: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
   6: tryCatchList(expr, classes, parentenv, handlers)
   7: tryCatch(withCallingHandlers(eval(code, test_env), expectation = handle_expectation,     skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error), error = function(e) {}, skip = function(e) {})
   8: test_code(desc, code, env = parent.frame())
   9: testthat::test_that("KMeans_rcpp returns the correct output for the initializers",     {        clust = 2        res = rep(NA, 4)        count = 1        set.seed(1)        for (i in c("kmeans++", "random", "optimal_init", "quantile_init")) {            km = KMeans_rcpp(X, clusters = clust, num_init = 5,                 max_iters = 10, initializer = i, tol_optimal_init = 0.2)            res[count] = (names(km) %in% c("clusters", "centroids",                 "total_SSE", "best_initialization", "WCSS_per_cluster",                 "obs_per_cluster", "between.SS_DIV_total.SS") &&                 is.vector(km$clusters) && length(km$clusters) ==                 nrow(X) && is.numeric(km$between.SS_DIV_total.SS) &&                 length(km$between.SS_DIV_total.SS) == 1 && nrow(km$centroids) ==                 clust && ncol(km$centroids) == ncol(X) && length(km$total_SSE) ==                 1 && is.numeric(km$total_SSE) && length(km$best_initialization) ==                 1 && is.numeric(km$best_initialization) && ncol(km$WCSS_per_cluster) ==                 clust && ncol(km$obs_per_cluster) == clust &&                 class(km) == "k-means clustering")            count = count + 1        }        testthat::expect_true(sum(res) == 4)    })
  10: eval(exprs, env)
  11: eval(exprs, env)
  12: source_file(path, new.env(parent = env), chdir = TRUE)
  13: force(code)
  14: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,     {        lister$start_file(basename(path))        source_file(path, new.env(parent = env), chdir = TRUE)        end_context()    })
  15: FUN(X[[i]], ...)
  16: lapply(paths, test_file, env = env, reporter = current_reporter,     start_end_reporter = FALSE, load_helpers = FALSE)
  17: force(code)
  18: with_reporter(reporter = current_reporter, results <- lapply(paths,     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,     load_helpers = FALSE))
  19: test_files(paths, reporter = reporter, env = env, ...)
  20: test_dir(test_path, reporter = reporter, env = env, filter = filter,     ...)
  21: with_top_env(env, {    test_dir(test_path, reporter = reporter, env = env, filter = filter,         ...)})
  22: run_tests(package, test_path, filter, reporter, ...)
  23: test_check("ClusterR")
  An irrecoverable exception occurred. R is aborting now ...