Running 'testthat.R' [63s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(dtwclust)
  Loading required package: proxy
  
  Attaching package: 'proxy'
  
  The following objects are masked from 'package:stats':
  
      as.dist, dist
  
  The following object is masked from 'package:base':
  
      as.matrix
  
  Loading required package: dtw
  Loaded dtw v1.23-1. See ?dtw for help, citation("dtw") for use in publication.
  
  dtwclust:
  Setting random number generator to L'Ecuyer-CMRG (see RNGkind()).
  To read the included vignettes type: browseVignettes("dtwclust").
  See news(package = "dtwclust") after package updates.
  > library(foreach)
  > library(testthat)
  > 
  > # coverage for multi-threading might not be possible (?)
  > if (nzchar(Sys.getenv("R_COVR"))) RcppParallel::setThreadOptions(1L)
  > # old reporter for CMD checks
  > options(testthat.default_reporter = "summary")
  > 
  > #' To test in a local machine:
  > #' Sys.setenv(NOT_CRAN = "true"); test_dir("tests/testthat/")
  > #' OR
  > #' devtools::test() # fixed? https://github.com/r-lib/devtools/issues/1832
  > #'
  > #' To disable parallel tests, before calling test() run:
  > #'
  > #'   options(dtwclust_skip_par_tests = TRUE)
  > #'
  > testthat::test_check("dtwclust")
  [ FAIL 14 | WARN 0 | SKIP 2 | PASS 1754 ]
  
  ══ Skipped tests (2) ═══════════════════════════════════════════════════════════
  • On CRAN (1): 'test-06-parallel.R:16:5'
  • sequential case (1): ???
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (???): Methods for TSClusters objects are dispatched correctly. ───────
  Error in `crossprod(x - y)`: "crossprod" is not a BUILTIN function
  Backtrace:
      ▆
   1. ├─proxy::dist(data_reinterpolated_subset, method = "L2")
   2. │ └─proxy (local) .proxy_external(R_apply_dist_list, x, NULL)
   3. │   └─base::do.call(...)
   4. └─proxy (local) `<fn>`(`<dbl>`, `<dbl>`)
  ── Error (???): Included as.* methods are dispatched correctly. ────────────────
  Error in `crossprod(x - y)`: "crossprod" is not a BUILTIN function
  Backtrace:
      ▆
   1. ├─proxy::dist(data_reinterpolated_subset, data_reinterpolated_subset)
   2. │ └─proxy (local) .proxy_external(R_apply_dist_list, x, y)
   3. │   └─base::do.call(...)
   4. └─proxy (local) `<fn>`(`<dbl>`, `<dbl>`)
  ── Error (???): CVIs work also for hierarchical and TADPole ────────────────────
  Error in `crossprod(x - y)`: "crossprod" is not a BUILTIN function
  Backtrace:
      ▆
   1. ├─dtwclust::tsclust(...)
   2. │ └─dtwclust::TADPole(...)
   3. │   └─proxy::dist(x, x, method = "L2")
   4. │     └─proxy (local) .proxy_external(R_apply_dist_list, x, y)
   5. │       └─base::do.call(...)
   6. └─proxy (local) `<fn>`(`<dbl>`, `<dbl>`)
  ── Error (???): CVIs work also for hierarchical and TADPole with custom centroid ──
  Error in `crossprod(x - y)`: "crossprod" is not a BUILTIN function
  Backtrace:
      ▆
   1. ├─dtwclust::tsclust(...)
   2. │ └─dtwclust::TADPole(...)
   3. │   └─proxy::dist(x, x, method = "L2")
   4. │     └─proxy (local) .proxy_external(R_apply_dist_list, x, y)
   5. │       └─base::do.call(...)
   6. └─proxy (local) `<fn>`(`<dbl>`, `<dbl>`)
  ── Error (???): The indices for load balancing always cover the whole distance matrix. ──
  Error in `crossprod(x - y)`: "crossprod" is not a BUILTIN function
  Backtrace:
      ▆
   1. ├─base::as.matrix(...)
   2. ├─base::do.call(proxy::dist, list(x = x[rows], y = x[ids], method = "L2"))
   3. ├─proxy (local) `<fn>`(x = `<named list>`, y = `<named list>`, method = "L2")
   4. │ └─proxy (local) .proxy_external(R_apply_dist_list, x, y)
   5. │   └─base::do.call(...)
   6. └─proxy (local) `<fn>`(`<dbl>`, `<dbl>`)
  ── Error (???): Results are the same regardless of data format, as long as supported by tsclust. ──
  Error in `crossprod(x - y)`: "crossprod" is not a BUILTIN function
  Backtrace:
       ▆
    1. ├─dtwclust::tsclust(...)
    2. │ └─dtwclust:::pam_distmat(...)
    3. │   ├─Distmat$new(...)
    4. │   │ └─methods::new(def, ...)
    5. │   │   ├─methods::initialize(value, ...)
    6. │   │   └─methods::initialize(value, ...)
    7. │   │     └─.Object$initialize(...)
    8. │   │       └─dtwclust (local) initFields(..., distmat = distmat)
    9. │   │         └─methods::initRefFields(...)
   10. │   └─dtwclust:::quoted_call(...)
   11. │     ├─base::do.call(fun, enlist(..., dots = dots), quote = TRUE)
   12. │     └─dtwclust (local) `<fn>`(x = base::quote(`<named list>`), centroids = base::quote(NULL))
   13. │       ├─base::as.matrix(...)
   14. │       └─dtwclust:::quoted_call(...)
   15. │         ├─base::do.call(fun, enlist(..., dots = dots), quote = TRUE)
   16. │         └─proxy (local) `<fn>`(...)
   17. │           └─proxy (local) .proxy_external(R_apply_dist_list, x, NULL)
   18. │             └─base::do.call(...)
   19. └─proxy (local) `<fn>`(`<dbl>`, `<dbl>`)
  ── Error (???): Multiple k works as expected. ──────────────────────────────────
  Error in `{
      if (trace) 
          message("Repetition ", i, " for k = ", k)
      assign(".Random.seed", rng[[i]], .GlobalEnv)
      if (!check_consistency(dist_entry$names[1L], "dist")) 
          do.call(proxy::pr_DB$set_entry, dist_entry, TRUE)
      list(quoted_call(pfclust, x = series, k = k, family = family, 
          control = control, fuzzy = isTRUE(type == "fuzzy"), cent = cent_char, 
          trace = trace, args = args))
  }`: task 1 failed - ""crossprod" is not a BUILTIN function"
  Backtrace:
      ▆
   1. └─dtwclust::tsclust(...)
   2.   └─... %this_op% ...
  ── Error (???): Fuzzy clustering works as expected. ────────────────────────────
  Error in `crossprod(x - y)`: "crossprod" is not a BUILTIN function
  Backtrace:
       ▆
    1. ├─dtwclust::tsclust(...)
    2. │ └─dtwclust:::quoted_call(...)
    3. │   ├─base::do.call(fun, enlist(..., dots = dots), quote = TRUE)
    4. │   └─dtwclust (local) `<fn>`(...)
    5. │     └─dtwclust:::quoted_call(...)
    6. │       ├─base::do.call(fun, enlist(..., dots = dots), quote = TRUE)
    7. │       └─dtwclust (local) `<fn>`(x = base::quote(`<named list>`), centroids = base::quote(`<list>`))
    8. │         ├─base::as.matrix(...)
    9. │         └─dtwclust:::quoted_call(...)
   10. │           ├─base::do.call(fun, enlist(..., dots = dots), quote = TRUE)
   11. │           └─proxy (local) `<fn>`(...)
   12. │             └─proxy (local) .proxy_external(R_apply_dist_list, x, y)
   13. │               └─base::do.call(...)
   14. └─proxy (local) `<fn>`(`<dbl>`, `<dbl>`)
  ── Error (???): Operations with custom fuzzy centroid complete successfully. ───
  Error in `crossprod(x - y)`: "crossprod" is not a BUILTIN function
  Backtrace:
       ▆
    1. ├─testthat::expect_output(...)
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─testthat::capture_output_lines(code, print, width = width)
    5. │   │   └─testthat:::eval_with_output(code, print = print, width = width)
    6. │   │     ├─withr::with_output_sink(path, withVisible(code))
    7. │   │     │ └─base::force(code)
    8. │   │     └─base::withVisible(code)
    9. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   10. ├─dtwclust::tsclust(...)
   11. │ └─dtwclust:::quoted_call(...)
   12. │   ├─base::do.call(fun, enlist(..., dots = dots), quote = TRUE)
   13. │   └─dtwclust (local) `<fn>`(...)
   14. │     └─dtwclust:::quoted_call(...)
   15. │       ├─base::do.call(fun, enlist(..., dots = dots), quote = TRUE)
   16. │       └─dtwclust (local) `<fn>`(x = base::quote(`<named list>`), centroids = base::quote(`<named list>`))
   17. │         ├─base::as.matrix(...)
   18. │         └─dtwclust:::quoted_call(...)
   19. │           ├─base::do.call(fun, enlist(..., dots = dots), quote = TRUE)
   20. │           └─proxy (local) `<fn>`(...)
   21. │             └─proxy (local) .proxy_external(R_apply_dist_list, x, y)
   22. │               └─base::do.call(...)
   23. └─proxy (local) `<fn>`(`<dbl>`, `<dbl>`)
  ── Error (???): Multiple k works as expected. ──────────────────────────────────
  Error in `crossprod(x - y)`: "crossprod" is not a BUILTIN function
  Backtrace:
       ▆
    1. ├─dtwclust::tsclust(...)
    2. │ └─dtwclust:::quoted_call(...)
    3. │   ├─base::do.call(fun, enlist(..., dots = dots), quote = TRUE)
    4. │   └─dtwclust (local) `<fn>`(x = base::quote(`<named list>`), centroids = base::quote(NULL))
    5. │     ├─base::as.matrix(...)
    6. │     └─dtwclust:::quoted_call(...)
    7. │       ├─base::do.call(fun, enlist(..., dots = dots), quote = TRUE)
    8. │       └─proxy (local) `<fn>`(...)
    9. │         └─proxy (local) .proxy_external(R_apply_dist_list, x, NULL)
   10. │           └─base::do.call(...)
   11. └─proxy (local) `<fn>`(`<dbl>`, `<dbl>`)
  ── Error (???): Multiple k and multiple repetitions work as expected. ──────────
  Error in `crossprod(x - y)`: "crossprod" is not a BUILTIN function
  Backtrace:
       ▆
    1. ├─dtwclust::tsclust(...)
    2. │ └─dtwclust:::pam_distmat(...)
    3. │   ├─Distmat$new(...)
    4. │   │ └─methods::new(def, ...)
    5. │   │   ├─methods::initialize(value, ...)
    6. │   │   └─methods::initialize(value, ...)
    7. │   │     └─.Object$initialize(...)
    8. │   │       └─dtwclust (local) initFields(..., distmat = distmat)
    9. │   │         └─methods::initRefFields(...)
   10. │   └─dtwclust:::quoted_call(...)
   11. │     ├─base::do.call(fun, enlist(..., dots = dots), quote = TRUE)
   12. │     └─dtwclust (local) `<fn>`(x = base::quote(`<named list>`), centroids = base::quote(NULL))
   13. │       ├─base::as.matrix(...)
   14. │       └─dtwclust:::quoted_call(...)
   15. │         ├─base::do.call(fun, enlist(..., dots = dots), quote = TRUE)
   16. │         └─proxy (local) `<fn>`(...)
   17. │           └─proxy (local) .proxy_external(R_apply_dist_list, x, NULL)
   18. │             └─base::do.call(...)
   19. └─proxy (local) `<fn>`(`<dbl>`, `<dbl>`)
  ── Error (???): TADPole works as expected ──────────────────────────────────────
  Error in `crossprod(x - y)`: "crossprod" is not a BUILTIN function
  Backtrace:
      ▆
   1. ├─dtwclust::tsclust(...)
   2. │ └─dtwclust::TADPole(...)
   3. │   └─proxy::dist(x, x, method = "L2")
   4. │     └─proxy (local) .proxy_external(R_apply_dist_list, x, y)
   5. │       └─base::do.call(...)
   6. └─proxy (local) `<fn>`(`<dbl>`, `<dbl>`)
  ── Error (???): cvi_evaluators work nicely with compare_clusterings. ───────────
  Error in `{
      cfg <- config[i, , drop = FALSE]
      seed <- seeds[[i]]
      if (trace) {
          message("-------------- Using configuration: --------------")
          print(cfg)
      }
      args <- lapply(c("preproc", "distance", "centroid"), function(func) {
          col_ids <- grepl(paste0("_", func, "$"), names(cfg))
          if (cfg[[func]] != "none" && any(col_ids)) {
              this_args <- as.list(cfg[, col_ids, drop = FALSE])
              names(this_args) <- sub(paste0("_", func, "$"), "", 
                  names(this_args))
              ans <- this_args[!sapply(this_args, is.na)]
              if (any(sapply(ans, is.list))) {
                  unlist(ans, recursive = FALSE)
              }
              else {
                  ans
              }
          }
          else {
              list()
          }
      })
      setnames_inplace(args, c("preproc", "dist", "cent"))
      args <- do.call(tsclust_args, args, TRUE)
      control_fun <- match.fun(paste0(type, "_control"))
      control_args <- subset_dots(as.list(cfg), control_fun)
      control_args <- lapply(control_args, unlist, recursive = FALSE)
      control <- do.call(control_fun, control_args, TRUE)
      preproc_char <- cfg$preproc
      config_ids <- lapply(series, attr, which = "config_ids")
      if (preproc_char == "none") 
          this_series <- which(sapply(config_ids, is.null))
      else this_series <- which(sapply(config_ids, function(cfg_id) {
          i %in% cfg_id
      }))
      if (length(this_series) > 1L) 
          stop("Could not find unique processed series for ", type, 
              " clustering and config row=", i)
      else this_series <- series[[this_series]]
      if (type != "tadpole") {
          distance <- cfg$distance
          dist_entry <- dist_entries[[distance]]
          if (!check_consistency(dist_entry$names[1L], "dist")) 
              do.call(proxy::pr_DB$set_entry, dist_entry, TRUE)
      }
      else distance <- NULL
      centroid_char <- cfg$centroid
      this_args <- enlist(series = this_series, type = type, k = unlist(cfg$k), 
          distance = distance, seed = seed, trace = trace, args = args, 
          control = control, error.check = FALSE, dots = dots)
      if (type == "tadpole") 
          this_args$distance <- NULL
      if (centroid_char == "default") {
          tsc <- do.call(tsclust, this_args, TRUE)
      }
      else if (type %in% c("partitional", "fuzzy") && centroid_char %in% 
          centroids_included) {
          tsc <- quoted_call(tsclust, centroid = centroid_char, 
              dots = this_args)
      }
      else {
          tsc <- quoted_call(tsclust, centroid = get_from_callers(centroid_char, 
              "function"), dots = this_args)
      }
      if (inherits(tsc, "TSClusters")) 
          tsc <- list(tsc)
      ret <- lapply(tsc, function(tsc) {
          tsc@preproc <- preproc_char
          if (preproc_char != "none") 
              tsc@family@preproc <- get_from_callers(preproc_char, 
                  "function")
          if (centroid_char != "default") 
              tsc@centroid <- centroid_char
          tsc
      })
      if (!return.objects) {
          if (!is.function(score.clus)) 
              score.clus <- score.clus[[type]]
          ret <- list(quoted_call(score.clus, ret, dots = dots))
      }
      ret
  }`: task 1 failed - ""crossprod" is not a BUILTIN function"
  Backtrace:
      ▆
   1. └─dtwclust::compare_clusterings(...)
   2.   └─base::Map(...)
   3.     └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
   4.       └─dtwclust (local) `<fn>`(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]])
   5.         └─... %op% ...
  ── Error (???): Compare clusterings works for the minimum set with all possibilities. ──
  Error in `{
      cfg <- config[i, , drop = FALSE]
      seed <- seeds[[i]]
      if (trace) {
          message("-------------- Using configuration: --------------")
          print(cfg)
      }
      args <- lapply(c("preproc", "distance", "centroid"), function(func) {
          col_ids <- grepl(paste0("_", func, "$"), names(cfg))
          if (cfg[[func]] != "none" && any(col_ids)) {
              this_args <- as.list(cfg[, col_ids, drop = FALSE])
              names(this_args) <- sub(paste0("_", func, "$"), "", 
                  names(this_args))
              ans <- this_args[!sapply(this_args, is.na)]
              if (any(sapply(ans, is.list))) {
                  unlist(ans, recursive = FALSE)
              }
              else {
                  ans
              }
          }
          else {
              list()
          }
      })
      setnames_inplace(args, c("preproc", "dist", "cent"))
      args <- do.call(tsclust_args, args, TRUE)
      control_fun <- match.fun(paste0(type, "_control"))
      control_args <- subset_dots(as.list(cfg), control_fun)
      control_args <- lapply(control_args, unlist, recursive = FALSE)
      control <- do.call(control_fun, control_args, TRUE)
      preproc_char <- cfg$preproc
      config_ids <- lapply(series, attr, which = "config_ids")
      if (preproc_char == "none") 
          this_series <- which(sapply(config_ids, is.null))
      else this_series <- which(sapply(config_ids, function(cfg_id) {
          i %in% cfg_id
      }))
      if (length(this_series) > 1L) 
          stop("Could not find unique processed series for ", type, 
              " clustering and config row=", i)
      else this_series <- series[[this_series]]
      if (type != "tadpole") {
          distance <- cfg$distance
          dist_entry <- dist_entries[[distance]]
          if (!check_consistency(dist_entry$names[1L], "dist")) 
              do.call(proxy::pr_DB$set_entry, dist_entry, TRUE)
      }
      else distance <- NULL
      centroid_char <- cfg$centroid
      this_args <- enlist(series = this_series, type = type, k = unlist(cfg$k), 
          distance = distance, seed = seed, trace = trace, args = args, 
          control = control, error.check = FALSE, dots = dots)
      if (type == "tadpole") 
          this_args$distance <- NULL
      if (centroid_char == "default") {
          tsc <- do.call(tsclust, this_args, TRUE)
      }
      else if (type %in% c("partitional", "fuzzy") && centroid_char %in% 
          centroids_included) {
          tsc <- quoted_call(tsclust, centroid = centroid_char, 
              dots = this_args)
      }
      else {
          tsc <- quoted_call(tsclust, centroid = get_from_callers(centroid_char, 
              "function"), dots = this_args)
      }
      if (inherits(tsc, "TSClusters")) 
          tsc <- list(tsc)
      ret <- lapply(tsc, function(tsc) {
          tsc@preproc <- preproc_char
          if (preproc_char != "none") 
              tsc@family@preproc <- get_from_callers(preproc_char, 
                  "function")
          if (centroid_char != "default") 
              tsc@centroid <- centroid_char
          tsc
      })
      if (!return.objects) {
          if (!is.function(score.clus)) 
              score.clus <- score.clus[[type]]
          ret <- list(quoted_call(score.clus, ret, dots = dots))
      }
      ret
  }`: task 1 failed - ""crossprod" is not a BUILTIN function"
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...)
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─dtwclust::compare_clusterings(...)
    7.   └─base::Map(...)
    8.     └─base::mapply(FUN = f, ..., SIMPLIFY = FALSE)
    9.       └─dtwclust (local) `<fn>`(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]])
   10.         └─... %op% ...
  
  [ FAIL 14 | WARN 0 | SKIP 2 | PASS 1754 ]
  Error: Test failures
  Execution halted