CRAN Package Check Results for Package funcy

Last updated on 2020-02-19 10:48:53 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.0.1 49.16 174.76 223.92 ERROR
r-devel-linux-x86_64-debian-gcc 1.0.1 35.98 131.76 167.74 ERROR
r-devel-linux-x86_64-fedora-clang 1.0.1 268.91 ERROR
r-devel-linux-x86_64-fedora-gcc 1.0.1 262.56 ERROR
r-devel-windows-ix86+x86_64 1.0.1 90.00 652.00 742.00 OK
r-devel-windows-ix86+x86_64-gcc8 1.0.1 109.00 832.00 941.00 OK
r-patched-linux-x86_64 1.0.1 40.13 368.77 408.90 OK
r-patched-solaris-x86 1.0.1 815.00 OK
r-release-linux-x86_64 1.0.1 38.19 377.13 415.32 OK
r-release-windows-ix86+x86_64 1.0.1 96.00 601.00 697.00 OK
r-release-osx-x86_64 1.0.1 OK
r-oldrel-windows-ix86+x86_64 1.0.1 76.00 514.00 590.00 OK
r-oldrel-osx-x86_64 1.0.1 OK

Check Details

Version: 1.0.1
Check: examples
Result: ERROR
    Running examples in 'funcy-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: accordance
    > ### Title: Accordance for cluster outcomes from different methods.
    > ### Aliases: accordance
    >
    > ### ** Examples
    >
    > ##Generate dataset
    > k <- 3
    > set.seed(2511)
    > ds <- sampleFuncy(obsNr=30, timeNr=10, reg=TRUE, k=k, sd=.4)
    >
    > ##Cluster dataset
    > res1 <- funcit(methods=1:3, data=Data(ds), k=4, clusters=Cluster(ds))
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    funcy
     --- call from context ---
    funcit(methods = 1:3, data = Data(ds), k = 4, clusters = Cluster(ds))
     --- call from argument ---
    if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
    where 1: funcit(methods = 1:3, data = Data(ds), k = 4, clusters = Cluster(ds))
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
    {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
    }
    <bytecode: 0x12baea48>
    <environment: namespace:funcy>
     --- function search by body ---
    Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data, :
     the condition has length > 1
    Calls: funcit
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.0.1
Check: tests
Result: ERROR
     Running 'testthat.R' [10s/12s]
    Running the tests in 'tests/testthat.R' failed.
    Complete output:
     > library(testthat)
     > library(funcy)
     Loading required package: flexclust
     Loading required package: grid
     Loading required package: lattice
     Loading required package: modeltools
     Loading required package: stats4
     Loading required package: splines
     >
     > test_check("funcy")
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     funcy
     --- call from context ---
     funcit(methods = methods, data = ds@data, k = k, clusters = ds@clusters,
     seed = 2405, save.data = TRUE, parallel = parallel)
     --- call from argument ---
     if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
     where 1: funcit(methods = methods, data = ds@data, k = k, clusters = ds@clusters,
     seed = 2405, save.data = TRUE, parallel = parallel)
     where 2: eval(expr, pf)
     where 3: eval(expr, pf)
     where 4: withVisible(eval(expr, pf))
     where 5: evalVis(expr)
     where 6 at testthat/test-old-unit-tests.R#7: capture.output(result <- expr)
     where 7 at testthat/test-old-unit-tests.R#22: silent(funcit(methods = methods, data = ds@data, k = k, clusters = ds@clusters,
     seed = 2405, save.data = TRUE, parallel = parallel))
     where 8: eval(code, test_env)
     where 9: eval(code, test_env)
     where 10: 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 11: doTryCatch(return(expr), name, parentenv, handler)
     where 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 14: doTryCatch(return(expr), name, parentenv, handler)
     where 15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 16: tryCatchList(expr, classes, parentenv, handlers)
     where 17: 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 18: test_code(desc, code, env = parent.frame())
     where 19 at testthat/test-old-unit-tests.R#20: test_that("All Cluster algorithms work", {
     res1 <- silent(funcit(methods = methods, data = ds@data,
     k = k, clusters = ds@clusters, seed = 2405, save.data = TRUE,
     parallel = parallel))
     })
     where 20: eval(code, test_env)
     where 21: eval(code, test_env)
     where 22: 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 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 26: doTryCatch(return(expr), name, parentenv, handler)
     where 27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 28: tryCatchList(expr, classes, parentenv, handlers)
     where 29: 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 30: test_code(NULL, exprs, env)
     where 31: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 32: force(code)
     where 33: doWithOneRestart(return(expr), restart)
     where 34: withOneRestart(expr, restarts[[1L]])
     where 35: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 36: 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 37: FUN(X[[i]], ...)
     where 38: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 39: force(code)
     where 40: doWithOneRestart(return(expr), restart)
     where 41: withOneRestart(expr, restarts[[1L]])
     where 42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 43: 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 44: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 45: 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 46: 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 47: test_check("funcy")
    
     --- value of length: 2 type: logical ---
     [1] FALSE TRUE
     --- function from context ---
     function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
     {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
     }
     <bytecode: 0x79dc7a0>
     <environment: namespace:funcy>
     --- function search by body ---
     Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
     -- 1. Error: All Cluster algorithms work (@test-old-unit-tests.R#22) ----------
     the condition has length > 1
     Backtrace:
     1. funcy:::silent(...)
     7. funcy::funcit(...)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     funcy
     --- call from context ---
     funcit(methods = methods, seed = 2506, data = data, k = 4)
     --- call from argument ---
     if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
     where 1: funcit(methods = methods, seed = 2506, data = data, k = 4)
     where 2: eval(expr, pf)
     where 3: eval(expr, pf)
     where 4: withVisible(eval(expr, pf))
     where 5: evalVis(expr)
     where 6 at testthat/test-old-unit-tests.R#7: capture.output(result <- expr)
     where 7 at testthat/test-old-unit-tests.R#46: silent(funcit(methods = methods, seed = 2506, data = data, k = 4))
     where 8: eval(code, test_env)
     where 9: eval(code, test_env)
     where 10: 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 11: doTryCatch(return(expr), name, parentenv, handler)
     where 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 14: doTryCatch(return(expr), name, parentenv, handler)
     where 15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 16: tryCatchList(expr, classes, parentenv, handlers)
     where 17: 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 18: test_code(desc, code, env = parent.frame())
     where 19 at testthat/test-old-unit-tests.R#36: test_that("Making an irregular data set regular", {
     data <- expect_silent(regFuncy(ds@data, timeNr = 10, nbasis = 5,
     method = "interpolate"))
     data <- expect_silent(regFuncy(ds@data, baseType = "splines",
     timeNr = 10, nbasis = 10, method = "project")$data)
     res2 <- silent(funcit(methods = methods, seed = 2506, data = data,
     k = 4))
     cl <- lapply(res2@models, class)
     expected <- structure(c("funcyOutMbc-fitfclust", "funcyOut",
     "funcyOut-iterSubspace", "funcyOutMbc", "funcyOutMbc-fscm",
     "funcyOutMbc"), .Names = c("fitfclust", "distclust",
     "iterSubspace", "funHDDC", "fscm", "waveclust"))
     expect_equal(object = unlist(cl), expected = expected)
     })
     where 20: eval(code, test_env)
     where 21: eval(code, test_env)
     where 22: 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 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 26: doTryCatch(return(expr), name, parentenv, handler)
     where 27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 28: tryCatchList(expr, classes, parentenv, handlers)
     where 29: 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 30: test_code(NULL, exprs, env)
     where 31: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 32: force(code)
     where 33: doWithOneRestart(return(expr), restart)
     where 34: withOneRestart(expr, restarts[[1L]])
     where 35: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 36: 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 37: FUN(X[[i]], ...)
     where 38: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 39: force(code)
     where 40: doWithOneRestart(return(expr), restart)
     where 41: withOneRestart(expr, restarts[[1L]])
     where 42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 43: 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 44: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 45: 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 46: 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 47: test_check("funcy")
    
     --- value of length: 2 type: logical ---
     [1] FALSE TRUE
     --- function from context ---
     function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
     {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
     }
     <bytecode: 0x79dc7a0>
     <environment: namespace:funcy>
     --- function search by body ---
     Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
     -- 2. Error: Making an irregular data set regular (@test-old-unit-tests.R#46) -
     the condition has length > 1
     Backtrace:
     1. funcy:::silent(...)
     7. funcy::funcit(methods = methods, seed = 2506, data = data, k = 4)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     funcy
     --- call from context ---
     funcit(methods = c(1, 2, 3), data = ds@data, k = k, clusters = ds@clusters,
     fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc, save.data = TRUE,
     parallel = parallel)
     --- call from argument ---
     if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
     where 1: funcit(methods = c(1, 2, 3), data = ds@data, k = k, clusters = ds@clusters,
     fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc, save.data = TRUE,
     parallel = parallel)
     where 2: eval(expr, pf)
     where 3: eval(expr, pf)
     where 4: withVisible(eval(expr, pf))
     where 5: evalVis(expr)
     where 6 at testthat/test-old-unit-tests.R#7: capture.output(result <- expr)
     where 7 at testthat/test-old-unit-tests.R#76: silent(funcit(methods = c(1, 2, 3), data = ds@data, k = k, clusters = ds@clusters,
     fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc, save.data = TRUE,
     parallel = parallel))
     where 8: eval(code, test_env)
     where 9: eval(code, test_env)
     where 10: 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 11: doTryCatch(return(expr), name, parentenv, handler)
     where 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 14: doTryCatch(return(expr), name, parentenv, handler)
     where 15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 16: tryCatchList(expr, classes, parentenv, handlers)
     where 17: 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 18: test_code(desc, code, env = parent.frame())
     where 19 at testthat/test-old-unit-tests.R#65: test_that("Test control arguments", {
     k <- 4
     set.seed(3806)
     ds <- sampleFuncy(timeNrMin = 5, timeNrMax = 10, reg = FALSE,
     k = k, sd = 0.3)
     a <- list(coeffsCalc = "estimate", average = TRUE)
     fpcCtrl <- as(a, "fpcCtrl")
     b <- list(maxit = 5, baseType = "eigenbasis", flexDim = TRUE)
     funcyCtrlMbc <- as(b, "funcyCtrlMbc")
     res3 <- silent(funcit(methods = c(1, 2, 3), data = ds@data,
     k = k, clusters = ds@clusters, fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc,
     save.data = TRUE, parallel = parallel))
     })
     where 20: eval(code, test_env)
     where 21: eval(code, test_env)
     where 22: 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 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 26: doTryCatch(return(expr), name, parentenv, handler)
     where 27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 28: tryCatchList(expr, classes, parentenv, handlers)
     where 29: 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 30: test_code(NULL, exprs, env)
     where 31: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 32: force(code)
     where 33: doWithOneRestart(return(expr), restart)
     where 34: withOneRestart(expr, restarts[[1L]])
     where 35: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 36: 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 37: FUN(X[[i]], ...)
     where 38: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 39: force(code)
     where 40: doWithOneRestart(return(expr), restart)
     where 41: withOneRestart(expr, restarts[[1L]])
     where 42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 43: 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 44: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 45: 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 46: 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 47: test_check("funcy")
    
     --- value of length: 2 type: logical ---
     [1] FALSE TRUE
     --- function from context ---
     function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
     {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
     }
     <bytecode: 0x79dc7a0>
     <environment: namespace:funcy>
     --- function search by body ---
     Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
     -- 3. Error: Test control arguments (@test-old-unit-tests.R#76) ---------------
     the condition has length > 1
     Backtrace:
     1. funcy:::silent(...)
     7. funcy::funcit(...)
    
     == testthat results ===========================================================
     [ OK: 2 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 3 ]
     1. Error: All Cluster algorithms work (@test-old-unit-tests.R#22)
     2. Error: Making an irregular data set regular (@test-old-unit-tests.R#46)
     3. Error: Test control arguments (@test-old-unit-tests.R#76)
    
     Error: testthat unit tests failed
     Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.0.1
Check: examples
Result: ERROR
    Running examples in ‘funcy-Ex.R’ failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: accordance
    > ### Title: Accordance for cluster outcomes from different methods.
    > ### Aliases: accordance
    >
    > ### ** Examples
    >
    > ##Generate dataset
    > k <- 3
    > set.seed(2511)
    > ds <- sampleFuncy(obsNr=30, timeNr=10, reg=TRUE, k=k, sd=.4)
    >
    > ##Cluster dataset
    > res1 <- funcit(methods=1:3, data=Data(ds), k=4, clusters=Cluster(ds))
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    funcy
     --- call from context ---
    funcit(methods = 1:3, data = Data(ds), k = 4, clusters = Cluster(ds))
     --- call from argument ---
    if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
    where 1: funcit(methods = 1:3, data = Data(ds), k = 4, clusters = Cluster(ds))
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
    {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
    }
    <bytecode: 0x55ea57ab6008>
    <environment: namespace:funcy>
     --- function search by body ---
    Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data, :
     the condition has length > 1
    Calls: funcit
    Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 1.0.1
Check: tests
Result: ERROR
     Running ‘testthat.R’ [8s/15s]
    Running the tests in ‘tests/testthat.R’ failed.
    Complete output:
     > library(testthat)
     > library(funcy)
     Loading required package: flexclust
     Loading required package: grid
     Loading required package: lattice
     Loading required package: modeltools
     Loading required package: stats4
     Loading required package: splines
     >
     > test_check("funcy")
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     funcy
     --- call from context ---
     funcit(methods = methods, data = ds@data, k = k, clusters = ds@clusters,
     seed = 2405, save.data = TRUE, parallel = parallel)
     --- call from argument ---
     if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
     where 1: funcit(methods = methods, data = ds@data, k = k, clusters = ds@clusters,
     seed = 2405, save.data = TRUE, parallel = parallel)
     where 2: eval(expr, pf)
     where 3: eval(expr, pf)
     where 4: withVisible(eval(expr, pf))
     where 5: evalVis(expr)
     where 6 at testthat/test-old-unit-tests.R#7: capture.output(result <- expr)
     where 7 at testthat/test-old-unit-tests.R#22: silent(funcit(methods = methods, data = ds@data, k = k, clusters = ds@clusters,
     seed = 2405, save.data = TRUE, parallel = parallel))
     where 8: eval(code, test_env)
     where 9: eval(code, test_env)
     where 10: 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 11: doTryCatch(return(expr), name, parentenv, handler)
     where 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 14: doTryCatch(return(expr), name, parentenv, handler)
     where 15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 16: tryCatchList(expr, classes, parentenv, handlers)
     where 17: 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 18: test_code(desc, code, env = parent.frame())
     where 19 at testthat/test-old-unit-tests.R#20: test_that("All Cluster algorithms work", {
     res1 <- silent(funcit(methods = methods, data = ds@data,
     k = k, clusters = ds@clusters, seed = 2405, save.data = TRUE,
     parallel = parallel))
     })
     where 20: eval(code, test_env)
     where 21: eval(code, test_env)
     where 22: 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 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 26: doTryCatch(return(expr), name, parentenv, handler)
     where 27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 28: tryCatchList(expr, classes, parentenv, handlers)
     where 29: 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 30: test_code(NULL, exprs, env)
     where 31: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 32: force(code)
     where 33: doWithOneRestart(return(expr), restart)
     where 34: withOneRestart(expr, restarts[[1L]])
     where 35: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 36: 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 37: FUN(X[[i]], ...)
     where 38: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 39: force(code)
     where 40: doWithOneRestart(return(expr), restart)
     where 41: withOneRestart(expr, restarts[[1L]])
     where 42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 43: 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 44: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 45: 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 46: 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 47: test_check("funcy")
    
     --- value of length: 2 type: logical ---
     [1] FALSE TRUE
     --- function from context ---
     function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
     {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
     }
     <bytecode: 0x55b1f2a55080>
     <environment: namespace:funcy>
     --- function search by body ---
     Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
     ── 1. Error: All Cluster algorithms work (@test-old-unit-tests.R#22) ──────────
     the condition has length > 1
     Backtrace:
     1. funcy:::silent(...)
     7. funcy::funcit(...)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     funcy
     --- call from context ---
     funcit(methods = methods, seed = 2506, data = data, k = 4)
     --- call from argument ---
     if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
     where 1: funcit(methods = methods, seed = 2506, data = data, k = 4)
     where 2: eval(expr, pf)
     where 3: eval(expr, pf)
     where 4: withVisible(eval(expr, pf))
     where 5: evalVis(expr)
     where 6 at testthat/test-old-unit-tests.R#7: capture.output(result <- expr)
     where 7 at testthat/test-old-unit-tests.R#46: silent(funcit(methods = methods, seed = 2506, data = data, k = 4))
     where 8: eval(code, test_env)
     where 9: eval(code, test_env)
     where 10: 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 11: doTryCatch(return(expr), name, parentenv, handler)
     where 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 14: doTryCatch(return(expr), name, parentenv, handler)
     where 15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 16: tryCatchList(expr, classes, parentenv, handlers)
     where 17: 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 18: test_code(desc, code, env = parent.frame())
     where 19 at testthat/test-old-unit-tests.R#36: test_that("Making an irregular data set regular", {
     data <- expect_silent(regFuncy(ds@data, timeNr = 10, nbasis = 5,
     method = "interpolate"))
     data <- expect_silent(regFuncy(ds@data, baseType = "splines",
     timeNr = 10, nbasis = 10, method = "project")$data)
     res2 <- silent(funcit(methods = methods, seed = 2506, data = data,
     k = 4))
     cl <- lapply(res2@models, class)
     expected <- structure(c("funcyOutMbc-fitfclust", "funcyOut",
     "funcyOut-iterSubspace", "funcyOutMbc", "funcyOutMbc-fscm",
     "funcyOutMbc"), .Names = c("fitfclust", "distclust",
     "iterSubspace", "funHDDC", "fscm", "waveclust"))
     expect_equal(object = unlist(cl), expected = expected)
     })
     where 20: eval(code, test_env)
     where 21: eval(code, test_env)
     where 22: 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 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 26: doTryCatch(return(expr), name, parentenv, handler)
     where 27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 28: tryCatchList(expr, classes, parentenv, handlers)
     where 29: 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 30: test_code(NULL, exprs, env)
     where 31: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 32: force(code)
     where 33: doWithOneRestart(return(expr), restart)
     where 34: withOneRestart(expr, restarts[[1L]])
     where 35: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 36: 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 37: FUN(X[[i]], ...)
     where 38: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 39: force(code)
     where 40: doWithOneRestart(return(expr), restart)
     where 41: withOneRestart(expr, restarts[[1L]])
     where 42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 43: 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 44: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 45: 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 46: 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 47: test_check("funcy")
    
     --- value of length: 2 type: logical ---
     [1] FALSE TRUE
     --- function from context ---
     function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
     {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
     }
     <bytecode: 0x55b1f2a55080>
     <environment: namespace:funcy>
     --- function search by body ---
     Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
     ── 2. Error: Making an irregular data set regular (@test-old-unit-tests.R#46) ─
     the condition has length > 1
     Backtrace:
     1. funcy:::silent(...)
     7. funcy::funcit(methods = methods, seed = 2506, data = data, k = 4)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     funcy
     --- call from context ---
     funcit(methods = c(1, 2, 3), data = ds@data, k = k, clusters = ds@clusters,
     fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc, save.data = TRUE,
     parallel = parallel)
     --- call from argument ---
     if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
     where 1: funcit(methods = c(1, 2, 3), data = ds@data, k = k, clusters = ds@clusters,
     fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc, save.data = TRUE,
     parallel = parallel)
     where 2: eval(expr, pf)
     where 3: eval(expr, pf)
     where 4: withVisible(eval(expr, pf))
     where 5: evalVis(expr)
     where 6 at testthat/test-old-unit-tests.R#7: capture.output(result <- expr)
     where 7 at testthat/test-old-unit-tests.R#76: silent(funcit(methods = c(1, 2, 3), data = ds@data, k = k, clusters = ds@clusters,
     fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc, save.data = TRUE,
     parallel = parallel))
     where 8: eval(code, test_env)
     where 9: eval(code, test_env)
     where 10: 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 11: doTryCatch(return(expr), name, parentenv, handler)
     where 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 14: doTryCatch(return(expr), name, parentenv, handler)
     where 15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 16: tryCatchList(expr, classes, parentenv, handlers)
     where 17: 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 18: test_code(desc, code, env = parent.frame())
     where 19 at testthat/test-old-unit-tests.R#65: test_that("Test control arguments", {
     k <- 4
     set.seed(3806)
     ds <- sampleFuncy(timeNrMin = 5, timeNrMax = 10, reg = FALSE,
     k = k, sd = 0.3)
     a <- list(coeffsCalc = "estimate", average = TRUE)
     fpcCtrl <- as(a, "fpcCtrl")
     b <- list(maxit = 5, baseType = "eigenbasis", flexDim = TRUE)
     funcyCtrlMbc <- as(b, "funcyCtrlMbc")
     res3 <- silent(funcit(methods = c(1, 2, 3), data = ds@data,
     k = k, clusters = ds@clusters, fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc,
     save.data = TRUE, parallel = parallel))
     })
     where 20: eval(code, test_env)
     where 21: eval(code, test_env)
     where 22: 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 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 26: doTryCatch(return(expr), name, parentenv, handler)
     where 27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 28: tryCatchList(expr, classes, parentenv, handlers)
     where 29: 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 30: test_code(NULL, exprs, env)
     where 31: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 32: force(code)
     where 33: doWithOneRestart(return(expr), restart)
     where 34: withOneRestart(expr, restarts[[1L]])
     where 35: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 36: 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 37: FUN(X[[i]], ...)
     where 38: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 39: force(code)
     where 40: doWithOneRestart(return(expr), restart)
     where 41: withOneRestart(expr, restarts[[1L]])
     where 42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 43: 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 44: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 45: 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 46: 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 47: test_check("funcy")
    
     --- value of length: 2 type: logical ---
     [1] FALSE TRUE
     --- function from context ---
     function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
     {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
     }
     <bytecode: 0x55b1f2a55080>
     <environment: namespace:funcy>
     --- function search by body ---
     Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
     ── 3. Error: Test control arguments (@test-old-unit-tests.R#76) ───────────────
     the condition has length > 1
     Backtrace:
     1. funcy:::silent(...)
     7. funcy::funcit(...)
    
     ══ testthat results ═══════════════════════════════════════════════════════════
     [ OK: 2 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 3 ]
     1. Error: All Cluster algorithms work (@test-old-unit-tests.R#22)
     2. Error: Making an irregular data set regular (@test-old-unit-tests.R#46)
     3. Error: Test control arguments (@test-old-unit-tests.R#76)
    
     Error: testthat unit tests failed
     Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 1.0.1
Check: examples
Result: ERROR
    Running examples in ‘funcy-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: accordance
    > ### Title: Accordance for cluster outcomes from different methods.
    > ### Aliases: accordance
    >
    > ### ** Examples
    >
    > ##Generate dataset
    > k <- 3
    > set.seed(2511)
    > ds <- sampleFuncy(obsNr=30, timeNr=10, reg=TRUE, k=k, sd=.4)
    >
    > ##Cluster dataset
    > res1 <- funcit(methods=1:3, data=Data(ds), k=4, clusters=Cluster(ds))
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    funcy
     --- call from context ---
    funcit(methods = 1:3, data = Data(ds), k = 4, clusters = Cluster(ds))
     --- call from argument ---
    if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
    where 1: funcit(methods = 1:3, data = Data(ds), k = 4, clusters = Cluster(ds))
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
    {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
    }
    <bytecode: 0xb7080a0>
    <environment: namespace:funcy>
     --- function search by body ---
    Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data, :
     the condition has length > 1
    Calls: funcit
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang

Version: 1.0.1
Check: tests
Result: ERROR
     Running ‘testthat.R’ [13s/16s]
    Running the tests in ‘tests/testthat.R’ failed.
    Complete output:
     > library(testthat)
     > library(funcy)
     Loading required package: flexclust
     Loading required package: grid
     Loading required package: lattice
     Loading required package: modeltools
     Loading required package: stats4
     Loading required package: splines
     >
     > test_check("funcy")
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     funcy
     --- call from context ---
     funcit(methods = methods, data = ds@data, k = k, clusters = ds@clusters,
     seed = 2405, save.data = TRUE, parallel = parallel)
     --- call from argument ---
     if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
     where 1: funcit(methods = methods, data = ds@data, k = k, clusters = ds@clusters,
     seed = 2405, save.data = TRUE, parallel = parallel)
     where 2: eval(expr, pf)
     where 3: eval(expr, pf)
     where 4: withVisible(eval(expr, pf))
     where 5: evalVis(expr)
     where 6 at testthat/test-old-unit-tests.R#7: capture.output(result <- expr)
     where 7 at testthat/test-old-unit-tests.R#22: silent(funcit(methods = methods, data = ds@data, k = k, clusters = ds@clusters,
     seed = 2405, save.data = TRUE, parallel = parallel))
     where 8: eval(code, test_env)
     where 9: eval(code, test_env)
     where 10: 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 11: doTryCatch(return(expr), name, parentenv, handler)
     where 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 14: doTryCatch(return(expr), name, parentenv, handler)
     where 15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 16: tryCatchList(expr, classes, parentenv, handlers)
     where 17: 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 18: test_code(desc, code, env = parent.frame())
     where 19 at testthat/test-old-unit-tests.R#20: test_that("All Cluster algorithms work", {
     res1 <- silent(funcit(methods = methods, data = ds@data,
     k = k, clusters = ds@clusters, seed = 2405, save.data = TRUE,
     parallel = parallel))
     })
     where 20: eval(code, test_env)
     where 21: eval(code, test_env)
     where 22: 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 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 26: doTryCatch(return(expr), name, parentenv, handler)
     where 27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 28: tryCatchList(expr, classes, parentenv, handlers)
     where 29: 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 30: test_code(NULL, exprs, env)
     where 31: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 32: force(code)
     where 33: doWithOneRestart(return(expr), restart)
     where 34: withOneRestart(expr, restarts[[1L]])
     where 35: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 36: 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 37: FUN(X[[i]], ...)
     where 38: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 39: force(code)
     where 40: doWithOneRestart(return(expr), restart)
     where 41: withOneRestart(expr, restarts[[1L]])
     where 42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 43: 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 44: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 45: 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 46: 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 47: test_check("funcy")
    
     --- value of length: 2 type: logical ---
     [1] FALSE TRUE
     --- function from context ---
     function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
     {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
     }
     <bytecode: 0x7fada10>
     <environment: namespace:funcy>
     --- function search by body ---
     Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
     ── 1. Error: All Cluster algorithms work (@test-old-unit-tests.R#22) ──────────
     the condition has length > 1
     Backtrace:
     1. funcy:::silent(...)
     7. funcy::funcit(...)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     funcy
     --- call from context ---
     funcit(methods = methods, seed = 2506, data = data, k = 4)
     --- call from argument ---
     if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
     where 1: funcit(methods = methods, seed = 2506, data = data, k = 4)
     where 2: eval(expr, pf)
     where 3: eval(expr, pf)
     where 4: withVisible(eval(expr, pf))
     where 5: evalVis(expr)
     where 6 at testthat/test-old-unit-tests.R#7: capture.output(result <- expr)
     where 7 at testthat/test-old-unit-tests.R#46: silent(funcit(methods = methods, seed = 2506, data = data, k = 4))
     where 8: eval(code, test_env)
     where 9: eval(code, test_env)
     where 10: 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 11: doTryCatch(return(expr), name, parentenv, handler)
     where 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 14: doTryCatch(return(expr), name, parentenv, handler)
     where 15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 16: tryCatchList(expr, classes, parentenv, handlers)
     where 17: 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 18: test_code(desc, code, env = parent.frame())
     where 19 at testthat/test-old-unit-tests.R#36: test_that("Making an irregular data set regular", {
     data <- expect_silent(regFuncy(ds@data, timeNr = 10, nbasis = 5,
     method = "interpolate"))
     data <- expect_silent(regFuncy(ds@data, baseType = "splines",
     timeNr = 10, nbasis = 10, method = "project")$data)
     res2 <- silent(funcit(methods = methods, seed = 2506, data = data,
     k = 4))
     cl <- lapply(res2@models, class)
     expected <- structure(c("funcyOutMbc-fitfclust", "funcyOut",
     "funcyOut-iterSubspace", "funcyOutMbc", "funcyOutMbc-fscm",
     "funcyOutMbc"), .Names = c("fitfclust", "distclust",
     "iterSubspace", "funHDDC", "fscm", "waveclust"))
     expect_equal(object = unlist(cl), expected = expected)
     })
     where 20: eval(code, test_env)
     where 21: eval(code, test_env)
     where 22: 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 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 26: doTryCatch(return(expr), name, parentenv, handler)
     where 27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 28: tryCatchList(expr, classes, parentenv, handlers)
     where 29: 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 30: test_code(NULL, exprs, env)
     where 31: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 32: force(code)
     where 33: doWithOneRestart(return(expr), restart)
     where 34: withOneRestart(expr, restarts[[1L]])
     where 35: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 36: 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 37: FUN(X[[i]], ...)
     where 38: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 39: force(code)
     where 40: doWithOneRestart(return(expr), restart)
     where 41: withOneRestart(expr, restarts[[1L]])
     where 42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 43: 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 44: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 45: 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 46: 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 47: test_check("funcy")
    
     --- value of length: 2 type: logical ---
     [1] FALSE TRUE
     --- function from context ---
     function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
     {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
     }
     <bytecode: 0x7fada10>
     <environment: namespace:funcy>
     --- function search by body ---
     Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
     ── 2. Error: Making an irregular data set regular (@test-old-unit-tests.R#46) ─
     the condition has length > 1
     Backtrace:
     1. funcy:::silent(...)
     7. funcy::funcit(methods = methods, seed = 2506, data = data, k = 4)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     funcy
     --- call from context ---
     funcit(methods = c(1, 2, 3), data = ds@data, k = k, clusters = ds@clusters,
     fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc, save.data = TRUE,
     parallel = parallel)
     --- call from argument ---
     if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
     where 1: funcit(methods = c(1, 2, 3), data = ds@data, k = k, clusters = ds@clusters,
     fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc, save.data = TRUE,
     parallel = parallel)
     where 2: eval(expr, pf)
     where 3: eval(expr, pf)
     where 4: withVisible(eval(expr, pf))
     where 5: evalVis(expr)
     where 6 at testthat/test-old-unit-tests.R#7: capture.output(result <- expr)
     where 7 at testthat/test-old-unit-tests.R#76: silent(funcit(methods = c(1, 2, 3), data = ds@data, k = k, clusters = ds@clusters,
     fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc, save.data = TRUE,
     parallel = parallel))
     where 8: eval(code, test_env)
     where 9: eval(code, test_env)
     where 10: 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 11: doTryCatch(return(expr), name, parentenv, handler)
     where 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 14: doTryCatch(return(expr), name, parentenv, handler)
     where 15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 16: tryCatchList(expr, classes, parentenv, handlers)
     where 17: 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 18: test_code(desc, code, env = parent.frame())
     where 19 at testthat/test-old-unit-tests.R#65: test_that("Test control arguments", {
     k <- 4
     set.seed(3806)
     ds <- sampleFuncy(timeNrMin = 5, timeNrMax = 10, reg = FALSE,
     k = k, sd = 0.3)
     a <- list(coeffsCalc = "estimate", average = TRUE)
     fpcCtrl <- as(a, "fpcCtrl")
     b <- list(maxit = 5, baseType = "eigenbasis", flexDim = TRUE)
     funcyCtrlMbc <- as(b, "funcyCtrlMbc")
     res3 <- silent(funcit(methods = c(1, 2, 3), data = ds@data,
     k = k, clusters = ds@clusters, fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc,
     save.data = TRUE, parallel = parallel))
     })
     where 20: eval(code, test_env)
     where 21: eval(code, test_env)
     where 22: 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 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 26: doTryCatch(return(expr), name, parentenv, handler)
     where 27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 28: tryCatchList(expr, classes, parentenv, handlers)
     where 29: 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 30: test_code(NULL, exprs, env)
     where 31: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 32: force(code)
     where 33: doWithOneRestart(return(expr), restart)
     where 34: withOneRestart(expr, restarts[[1L]])
     where 35: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 36: 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 37: FUN(X[[i]], ...)
     where 38: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 39: force(code)
     where 40: doWithOneRestart(return(expr), restart)
     where 41: withOneRestart(expr, restarts[[1L]])
     where 42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 43: 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 44: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 45: 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 46: 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 47: test_check("funcy")
    
     --- value of length: 2 type: logical ---
     [1] FALSE TRUE
     --- function from context ---
     function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
     {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
     }
     <bytecode: 0x7fada10>
     <environment: namespace:funcy>
     --- function search by body ---
     Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
     ── 3. Error: Test control arguments (@test-old-unit-tests.R#76) ───────────────
     the condition has length > 1
     Backtrace:
     1. funcy:::silent(...)
     7. funcy::funcit(...)
    
     ══ testthat results ═══════════════════════════════════════════════════════════
     [ OK: 2 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 3 ]
     1. Error: All Cluster algorithms work (@test-old-unit-tests.R#22)
     2. Error: Making an irregular data set regular (@test-old-unit-tests.R#46)
     3. Error: Test control arguments (@test-old-unit-tests.R#76)
    
     Error: testthat unit tests failed
     Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang

Version: 1.0.1
Check: examples
Result: ERROR
    Running examples in ‘funcy-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: accordance
    > ### Title: Accordance for cluster outcomes from different methods.
    > ### Aliases: accordance
    >
    > ### ** Examples
    >
    > ##Generate dataset
    > k <- 3
    > set.seed(2511)
    > ds <- sampleFuncy(obsNr=30, timeNr=10, reg=TRUE, k=k, sd=.4)
    >
    > ##Cluster dataset
    > res1 <- funcit(methods=1:3, data=Data(ds), k=4, clusters=Cluster(ds))
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    funcy
     --- call from context ---
    funcit(methods = 1:3, data = Data(ds), k = 4, clusters = Cluster(ds))
     --- call from argument ---
    if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
    where 1: funcit(methods = 1:3, data = Data(ds), k = 4, clusters = Cluster(ds))
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
    {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
    }
    <bytecode: 0x123be6d0>
    <environment: namespace:funcy>
     --- function search by body ---
    Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data, :
     the condition has length > 1
    Calls: funcit
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc

Version: 1.0.1
Check: tests
Result: ERROR
     Running ‘testthat.R’ [13s/16s]
    Running the tests in ‘tests/testthat.R’ failed.
    Complete output:
     > library(testthat)
     > library(funcy)
     Loading required package: flexclust
     Loading required package: grid
     Loading required package: lattice
     Loading required package: modeltools
     Loading required package: stats4
     Loading required package: splines
     >
     > test_check("funcy")
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     funcy
     --- call from context ---
     funcit(methods = methods, data = ds@data, k = k, clusters = ds@clusters,
     seed = 2405, save.data = TRUE, parallel = parallel)
     --- call from argument ---
     if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
     where 1: funcit(methods = methods, data = ds@data, k = k, clusters = ds@clusters,
     seed = 2405, save.data = TRUE, parallel = parallel)
     where 2: eval(expr, pf)
     where 3: eval(expr, pf)
     where 4: withVisible(eval(expr, pf))
     where 5: evalVis(expr)
     where 6 at testthat/test-old-unit-tests.R#7: capture.output(result <- expr)
     where 7 at testthat/test-old-unit-tests.R#22: silent(funcit(methods = methods, data = ds@data, k = k, clusters = ds@clusters,
     seed = 2405, save.data = TRUE, parallel = parallel))
     where 8: eval(code, test_env)
     where 9: eval(code, test_env)
     where 10: 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 11: doTryCatch(return(expr), name, parentenv, handler)
     where 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 14: doTryCatch(return(expr), name, parentenv, handler)
     where 15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 16: tryCatchList(expr, classes, parentenv, handlers)
     where 17: 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 18: test_code(desc, code, env = parent.frame())
     where 19 at testthat/test-old-unit-tests.R#20: test_that("All Cluster algorithms work", {
     res1 <- silent(funcit(methods = methods, data = ds@data,
     k = k, clusters = ds@clusters, seed = 2405, save.data = TRUE,
     parallel = parallel))
     })
     where 20: eval(code, test_env)
     where 21: eval(code, test_env)
     where 22: 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 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 26: doTryCatch(return(expr), name, parentenv, handler)
     where 27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 28: tryCatchList(expr, classes, parentenv, handlers)
     where 29: 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 30: test_code(NULL, exprs, env)
     where 31: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 32: force(code)
     where 33: doWithOneRestart(return(expr), restart)
     where 34: withOneRestart(expr, restarts[[1L]])
     where 35: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 36: 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 37: FUN(X[[i]], ...)
     where 38: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 39: force(code)
     where 40: doWithOneRestart(return(expr), restart)
     where 41: withOneRestart(expr, restarts[[1L]])
     where 42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 43: 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 44: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 45: 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 46: 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 47: test_check("funcy")
    
     --- value of length: 2 type: logical ---
     [1] FALSE TRUE
     --- function from context ---
     function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
     {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
     }
     <bytecode: 0x8cd7fc8>
     <environment: namespace:funcy>
     --- function search by body ---
     Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
     ── 1. Error: All Cluster algorithms work (@test-old-unit-tests.R#22) ──────────
     the condition has length > 1
     Backtrace:
     1. funcy:::silent(...)
     7. funcy::funcit(...)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     funcy
     --- call from context ---
     funcit(methods = methods, seed = 2506, data = data, k = 4)
     --- call from argument ---
     if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
     where 1: funcit(methods = methods, seed = 2506, data = data, k = 4)
     where 2: eval(expr, pf)
     where 3: eval(expr, pf)
     where 4: withVisible(eval(expr, pf))
     where 5: evalVis(expr)
     where 6 at testthat/test-old-unit-tests.R#7: capture.output(result <- expr)
     where 7 at testthat/test-old-unit-tests.R#46: silent(funcit(methods = methods, seed = 2506, data = data, k = 4))
     where 8: eval(code, test_env)
     where 9: eval(code, test_env)
     where 10: 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 11: doTryCatch(return(expr), name, parentenv, handler)
     where 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 14: doTryCatch(return(expr), name, parentenv, handler)
     where 15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 16: tryCatchList(expr, classes, parentenv, handlers)
     where 17: 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 18: test_code(desc, code, env = parent.frame())
     where 19 at testthat/test-old-unit-tests.R#36: test_that("Making an irregular data set regular", {
     data <- expect_silent(regFuncy(ds@data, timeNr = 10, nbasis = 5,
     method = "interpolate"))
     data <- expect_silent(regFuncy(ds@data, baseType = "splines",
     timeNr = 10, nbasis = 10, method = "project")$data)
     res2 <- silent(funcit(methods = methods, seed = 2506, data = data,
     k = 4))
     cl <- lapply(res2@models, class)
     expected <- structure(c("funcyOutMbc-fitfclust", "funcyOut",
     "funcyOut-iterSubspace", "funcyOutMbc", "funcyOutMbc-fscm",
     "funcyOutMbc"), .Names = c("fitfclust", "distclust",
     "iterSubspace", "funHDDC", "fscm", "waveclust"))
     expect_equal(object = unlist(cl), expected = expected)
     })
     where 20: eval(code, test_env)
     where 21: eval(code, test_env)
     where 22: 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 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 26: doTryCatch(return(expr), name, parentenv, handler)
     where 27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 28: tryCatchList(expr, classes, parentenv, handlers)
     where 29: 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 30: test_code(NULL, exprs, env)
     where 31: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 32: force(code)
     where 33: doWithOneRestart(return(expr), restart)
     where 34: withOneRestart(expr, restarts[[1L]])
     where 35: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 36: 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 37: FUN(X[[i]], ...)
     where 38: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 39: force(code)
     where 40: doWithOneRestart(return(expr), restart)
     where 41: withOneRestart(expr, restarts[[1L]])
     where 42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 43: 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 44: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 45: 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 46: 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 47: test_check("funcy")
    
     --- value of length: 2 type: logical ---
     [1] FALSE TRUE
     --- function from context ---
     function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
     {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
     }
     <bytecode: 0x8cd7fc8>
     <environment: namespace:funcy>
     --- function search by body ---
     Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
     ── 2. Error: Making an irregular data set regular (@test-old-unit-tests.R#46) ─
     the condition has length > 1
     Backtrace:
     1. funcy:::silent(...)
     7. funcy::funcit(methods = methods, seed = 2506, data = data, k = 4)
    
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
     :
     --- package (from environment) ---
     funcy
     --- call from context ---
     funcit(methods = c(1, 2, 3), data = ds@data, k = k, clusters = ds@clusters,
     fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc, save.data = TRUE,
     parallel = parallel)
     --- call from argument ---
     if (!(class(data) %in% c("matrix", "data.frame"))) stop(paste(data,
     "must be given in matrix or data.frame format."))
     --- R stacktrace ---
     where 1: funcit(methods = c(1, 2, 3), data = ds@data, k = k, clusters = ds@clusters,
     fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc, save.data = TRUE,
     parallel = parallel)
     where 2: eval(expr, pf)
     where 3: eval(expr, pf)
     where 4: withVisible(eval(expr, pf))
     where 5: evalVis(expr)
     where 6 at testthat/test-old-unit-tests.R#7: capture.output(result <- expr)
     where 7 at testthat/test-old-unit-tests.R#76: silent(funcit(methods = c(1, 2, 3), data = ds@data, k = k, clusters = ds@clusters,
     fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc, save.data = TRUE,
     parallel = parallel))
     where 8: eval(code, test_env)
     where 9: eval(code, test_env)
     where 10: 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 11: doTryCatch(return(expr), name, parentenv, handler)
     where 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 14: doTryCatch(return(expr), name, parentenv, handler)
     where 15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 16: tryCatchList(expr, classes, parentenv, handlers)
     where 17: 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 18: test_code(desc, code, env = parent.frame())
     where 19 at testthat/test-old-unit-tests.R#65: test_that("Test control arguments", {
     k <- 4
     set.seed(3806)
     ds <- sampleFuncy(timeNrMin = 5, timeNrMax = 10, reg = FALSE,
     k = k, sd = 0.3)
     a <- list(coeffsCalc = "estimate", average = TRUE)
     fpcCtrl <- as(a, "fpcCtrl")
     b <- list(maxit = 5, baseType = "eigenbasis", flexDim = TRUE)
     funcyCtrlMbc <- as(b, "funcyCtrlMbc")
     res3 <- silent(funcit(methods = c(1, 2, 3), data = ds@data,
     k = k, clusters = ds@clusters, fpcCtrl = fpcCtrl, funcyCtrl = funcyCtrlMbc,
     save.data = TRUE, parallel = parallel))
     })
     where 20: eval(code, test_env)
     where 21: eval(code, test_env)
     where 22: 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 23: doTryCatch(return(expr), name, parentenv, handler)
     where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     where 25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     where 26: doTryCatch(return(expr), name, parentenv, handler)
     where 27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),
     names[nh], parentenv, handlers[[nh]])
     where 28: tryCatchList(expr, classes, parentenv, handlers)
     where 29: 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 30: test_code(NULL, exprs, env)
     where 31: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     where 32: force(code)
     where 33: doWithOneRestart(return(expr), restart)
     where 34: withOneRestart(expr, restarts[[1L]])
     where 35: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 36: 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 37: FUN(X[[i]], ...)
     where 38: lapply(paths, test_file, env = env, reporter = current_reporter,
     start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     where 39: force(code)
     where 40: doWithOneRestart(return(expr), restart)
     where 41: withOneRestart(expr, restarts[[1L]])
     where 42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
     where 43: 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 44: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure,
     stop_on_warning = stop_on_warning, wrap = wrap)
     where 45: 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 46: 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 47: test_check("funcy")
    
     --- value of length: 2 type: logical ---
     [1] FALSE TRUE
     --- function from context ---
     function (data, k, methods = c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust"), seed = NULL,
     regTime = NULL, clusters = NULL, funcyCtrl = NULL, fpcCtrl = NULL,
     parallel = FALSE, save.data = TRUE, ...)
     {
     if (missing(methods))
     stop("Please select one method or methods='ALL'.")
     else if (length(methods) == 1)
     if (methods == "ALL")
     methods <- 1:7
     allMethods <- c("fitfclust", "distclust", "iterSubspace",
     "funclust", "funHDDC", "fscm", "waveclust")
     if (is.numeric(methods))
     usedMethods <- allMethods[methods]
     else usedMethods <- match.arg(methods, allMethods, several.ok = TRUE)
     nrMethods <- length(usedMethods)
     if (missing(k))
     stop(paste(k, "is missing"))
     if (!(class(data) %in% c("matrix", "data.frame")))
     stop(paste(data, "must be given in matrix or data.frame format."))
     chf <- checkFormat(data)
     data <- chf$data
     reg <- chf$reg
     if (is.null(funcyCtrl))
     funcyCtrl <- new("funcyCtrl")
     funcyCtrl@seed <- seed
     if (sum(usedMethods %in% allMethods[c(1, 3, 4, 5, 6, 7)]) >
     0 & class(funcyCtrl) == "funcyCtrl")
     funcyCtrl <- as(funcyCtrl, "funcyCtrlMbc")
     if (funcyCtrl@baseType != "eigenbasis" & !is.null(fpcCtrl))
     warning("fpcCtrl is ignored since it controls only eigenbasis.")
     else if (funcyCtrl@baseType == "eigenbasis")
     fpcCtrl <- fpcCtrlCheck(fpcCtrl = fpcCtrl, data = data,
     reg = reg)
     if (reg == 0 & sum(usedMethods %in% c("fscm", "funclust",
     "funHDDC")) > 0) {
     notWork <- usedMethods[which(usedMethods %in% allMethods[-c(1:3)])]
     stop(paste("Algorithm", notWork, "works only on regular data!\n Please choose one of fitfclust, distclust or iterSubspace."))
     }
     if (nrMethods == 1)
     parallel <- FALSE
     if (.Platform$OS.type != "unix" & parallel) {
     warning("Parallel computing is only supported on Unix platforms.")
     parallel <- FALSE
     }
     if (parallel) {
     parallelFct <- parallel::mcparallel
     coresNr <- detectCores() - 1
     options(cores = coresNr)
     }
     else {
     parallelFct <- identity
     }
     RES <- list()
     if ("fitfclust" %in% usedMethods) {
     indx <- match("fitfclust", usedMethods)
     RES[[indx]] <- parallelFct(fitfclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("distclust" %in% usedMethods) {
     indx <- match("distclust", usedMethods)
     RES[[indx]] <- parallelFct(distclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrl = funcyCtrl, ...))
     }
     if ("iterSubspace" %in% usedMethods) {
     indx <- match("iterSubspace", usedMethods)
     RES[[indx]] <- parallelFct(iterSubspaceWrapper(data = data,
     k = k, reg = reg, regTime = regTime, fpcCtrl = fpcCtrl,
     funcyCtrlMbc = funcyCtrl, ...))
     }
     if ("funclust" %in% usedMethods) {
     .warn_once <- local({
     not.warned.yet <- TRUE
     function(x) {
     if (not.warned.yet) {
     warning("Funclustering is currently not available on CRAN.")
     not.warned.yet <<- FALSE
     }
     }
     })
     }
     if ("funHDDC" %in% usedMethods) {
     if (!requireNamespace("funHDDC"))
     stop("Please install package 'funHDDC' to use method 'funHDDC'.")
     indx <- match("funHDDC", usedMethods)
     RES[[indx]] <- parallelFct(funHDDCWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("fscm" %in% usedMethods) {
     indx <- match("fscm", usedMethods)
     RES[[indx]] <- parallelFct(fscmWrapper(data = data, k = k,
     reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     if ("waveclust" %in% usedMethods) {
     indx <- match("waveclust", usedMethods)
     RES[[indx]] <- parallelFct(waveclustWrapper(data = data,
     k = k, reg = reg, regTime = regTime, funcyCtrlMbc = funcyCtrl,
     ...))
     }
     FRES <- new("funcyOutList")
     FRES@call <- match.call()
     if (parallel)
     FRES@models <- parallel::mccollect(RES)
     else FRES@models <- RES
     names(FRES@models) <- usedMethods
     error <- which(sapply(FRES@models, class) == "try-error")
     if (sum(error) != 0)
     stop(paste("Method", usedMethods[error[1]], ":", attributes(FRES@models[[error[1]]])$condition$message))
     allClusters <- sapply(FRES@models, function(x) x@cluster)
     allCenters <- lapply(FRES@models, function(x) x@centers)
     names(allCenters) <- colnames(allClusters) <- usedMethods
     rI <- rIMethods(methodNames = usedMethods, cls = allClusters,
     trueCluster = clusters)
     if (nrMethods > 1) {
     rel <- relabelMethods(methodNames = usedMethods, cls = allClusters,
     ctrs = allCenters)
     allClusters <- rel$allClusters
     allCenters <- rel$allCenters
     for (i in 1:nrMethods) {
     FRES@models[[i]]@cluster <- allClusters[, i]
     FRES@models[[i]]@centers <- allCenters[[i]]
     FRES@models[[i]]@correctCl <- rI[i, i]
     }
     }
     smallCl <- which(apply(allClusters, 2, function(x) min(table(x))) <
     2)
     if (length(smallCl) != 0) {
     warning(paste("Method", usedMethods[smallCl], "has clusters with less than 3 obervations!\n"),
     immediate. = TRUE)
     }
     accord <- accordance(cls = allClusters, relabel = FALSE)
     if (save.data)
     FRES@data <- data
     else FRES@data <- as.matrix(NULL)
     FRES@timeNr <- calcTimeNr(data, reg)
     FRES@reg <- reg
     FRES@k <- k
     FRES@methodName <- usedMethods
     FRES@allClusters <- allClusters
     FRES@randIndex <- rI
     FRES@votedCluster <- accord$votedCluster
     FRES@accordance <- accord$accordance
     return(FRES)
     }
     <bytecode: 0x8cd7fc8>
     <environment: namespace:funcy>
     --- function search by body ---
     Function funcit in namespace funcy has this body.
     ----------- END OF FAILURE REPORT --------------
     ── 3. Error: Test control arguments (@test-old-unit-tests.R#76) ───────────────
     the condition has length > 1
     Backtrace:
     1. funcy:::silent(...)
     7. funcy::funcit(...)
    
     ══ testthat results ═══════════════════════════════════════════════════════════
     [ OK: 2 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 3 ]
     1. Error: All Cluster algorithms work (@test-old-unit-tests.R#22)
     2. Error: Making an irregular data set regular (@test-old-unit-tests.R#46)
     3. Error: Test control arguments (@test-old-unit-tests.R#76)
    
     Error: testthat unit tests failed
     Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc