Running 'testthat.R' [120s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(diceR)
  > 
  > test_check("diceR")
  -- 1. Error: evaluation works with reference class and can plot (@test-consensus
  Function found when exporting methods from the namespace 'dimRed' which is not S4 generic: 'nrow'
  1: expect_length(consensus_evaluate(x, CC1, CC2, cons.cl = cons.cl, ref.cl = ref.cl, 
         plot = TRUE), 5) at testthat/test-consensus_combine.R:24
  2: quasi_label(enquo(object))
  3: eval_bare(get_expr(quo), get_env(quo))
  4: consensus_evaluate(x, CC1, CC2, cons.cl = cons.cl, ref.cl = ref.cl, plot = TRUE)
  5: ref.cl %>% purrr::when(!is.null(.) ~ cl.mat %>% magrittr::extract(match(k, names(.))) %>% 
         purrr::map(evi_table, ref.cl = ref.cl), TRUE ~ NULL)
  6: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: `_fseq`(`_lhs`)
  10: freduce(value, `_function_list`)
  ...
  48: asNamespace(ns)
  49: getNamespace(ns)
  50: loadNamespace(name)
  51: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  52: asNamespace(ns)
  53: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  54: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  55: asNamespace(ns)
  56: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  57: stop(sprintf(msg, sQuote(package), paste(sQuote(bad), collapse = ", ")), domain = NA, 
         call. = FALSE)
  
  -- 2. Error: trimming (potentially) removes algorithms (@test-consensus_combine.
  Function found when exporting methods from the namespace 'dimRed' which is not S4 generic: 'nrow'
  1: consensus_evaluate(x, CC1, CC2, ref.cl = ref.cl, n = 1, trim = TRUE) at testthat/test-consensus_combine.R:41
  2: ref.cl %>% purrr::when(!is.null(.) ~ cl.mat %>% magrittr::extract(match(k, names(.))) %>% 
         purrr::map(evi_table, ref.cl = ref.cl), TRUE ~ NULL)
  3: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: eval(quote(`_fseq`(`_lhs`)), env, env)
  6: `_fseq`(`_lhs`)
  7: freduce(value, `_function_list`)
  8: withVisible(function_list[[k]](value))
  9: function_list[[k]](value)
  10: purrr::when(., !is.null(.) ~ cl.mat %>% magrittr::extract(match(k, names(.))) %>% 
         purrr::map(evi_table, ref.cl = ref.cl), TRUE ~ NULL)
  ...
  45: asNamespace(ns)
  46: getNamespace(ns)
  47: loadNamespace(name)
  48: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  49: asNamespace(ns)
  50: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  51: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  52: asNamespace(ns)
  53: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  54: stop(sprintf(msg, sQuote(package), paste(sQuote(bad), collapse = ", ")), domain = NA, 
         call. = FALSE)
  
  -- 3. Error: reweighing (potentially) replicates each slice of algorithm (@test-
  Function found when exporting methods from the namespace 'dimRed' which is not S4 generic: 'nrow'
  1: consensus_evaluate(x, CC1, CC2, ref.cl = ref.cl, trim = TRUE, reweigh = TRUE, k.method = "all") at testthat/test-consensus_combine.R:48
  2: ref.cl %>% purrr::when(!is.null(.) ~ cl.mat %>% magrittr::extract(match(k, names(.))) %>% 
         purrr::map(evi_table, ref.cl = ref.cl), TRUE ~ NULL)
  3: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: eval(quote(`_fseq`(`_lhs`)), env, env)
  6: `_fseq`(`_lhs`)
  7: freduce(value, `_function_list`)
  8: withVisible(function_list[[k]](value))
  9: function_list[[k]](value)
  10: purrr::when(., !is.null(.) ~ cl.mat %>% magrittr::extract(match(k, names(.))) %>% 
         purrr::map(evi_table, ref.cl = ref.cl), TRUE ~ NULL)
  ...
  45: asNamespace(ns)
  46: getNamespace(ns)
  47: loadNamespace(name)
  48: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  49: asNamespace(ns)
  50: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  51: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  52: asNamespace(ns)
  53: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  54: stop(sprintf(msg, sQuote(package), paste(sQuote(bad), collapse = ", ")), domain = NA, 
         call. = FALSE)
  
  Selecting k and imputing non-clustered cases
  Computing consensus functions
  Evaluating output with consensus function results
  Diverse Cluster Ensemble Completed
  Selecting k and imputing non-clustered cases
  -- 4. Error: dice works with multiple algorithms, consensus funs, trimming, and
  
  Function found when exporting methods from the namespace 'dimRed' which is not S4 generic: 'nrow'
  1: dice(hgsc, nk = 4, reps = 5, algorithms = c("hc", "diana"), cons.funs = c("kmodes", 
         "majority"), trim = TRUE, n = 2, ref.cl = ref.cl) at testthat/test-dice.R:18
  2: consensus_evaluate(data = data, Eknn, ref.cl = ref.cl, k.method = k.method, trim = trim, 
         reweigh = reweigh, n = n)
  3: ref.cl %>% purrr::when(!is.null(.) ~ cl.mat %>% magrittr::extract(match(k, names(.))) %>% 
         purrr::map(evi_table, ref.cl = ref.cl), TRUE ~ NULL)
  4: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  5: eval(quote(`_fseq`(`_lhs`)), env, env)
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: `_fseq`(`_lhs`)
  8: freduce(value, `_function_list`)
  9: withVisible(function_list[[k]](value))
  10: function_list[[k]](value)
  ...
  46: asNamespace(ns)
  47: getNamespace(ns)
  48: loadNamespace(name)
  49: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  50: asNamespace(ns)
  51: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  52: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  53: asNamespace(ns)
  54: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  55: stop(sprintf(msg, sQuote(package), paste(sQuote(bad), collapse = ", ")), domain = NA, 
         call. = FALSE)
  
  Selecting k and imputing non-clustered cases
  -- 5. Error: single algorithm and single consensus return same results (@test-di
  Function found when exporting methods from the namespace 'dimRed' which is not S4 generic: 'nrow'
  1: dice(hgsc, nk = 4, reps = 5, algorithms = "km", cons.funs = "CSPA", ref.cl = ref.cl) at testthat/test-dice.R:27
  2: consensus_evaluate(data = data, Eknn, ref.cl = ref.cl, k.method = k.method, trim = trim, 
         reweigh = reweigh, n = n)
  3: ref.cl %>% purrr::when(!is.null(.) ~ cl.mat %>% magrittr::extract(match(k, names(.))) %>% 
         purrr::map(evi_table, ref.cl = ref.cl), TRUE ~ NULL)
  4: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  5: eval(quote(`_fseq`(`_lhs`)), env, env)
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: `_fseq`(`_lhs`)
  8: freduce(value, `_function_list`)
  9: withVisible(function_list[[k]](value))
  10: function_list[[k]](value)
  ...
  46: asNamespace(ns)
  47: getNamespace(ns)
  48: loadNamespace(name)
  49: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  50: asNamespace(ns)
  51: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  52: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  53: asNamespace(ns)
  54: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  55: stop(sprintf(msg, sQuote(package), paste(sQuote(bad), collapse = ", ")), domain = NA, 
         call. = FALSE)
  
  Selecting k and imputing non-clustered cases
  -- 6. Error: indices slot returns NULL if evaluate specified as FALSE (@test-dic
  Function found when exporting methods from the namespace 'dimRed' which is not S4 generic: 'nrow'
  1: dice(hgsc, nk = 4, reps = 3, algorithms = "hc", cons.funs = "kmodes", ref.cl = ref.cl, 
         evaluate = FALSE) at testthat/test-dice.R:34
  2: consensus_evaluate(data = data, Eknn, ref.cl = ref.cl, k.method = k.method, trim = trim, 
         reweigh = reweigh, n = n)
  3: ref.cl %>% purrr::when(!is.null(.) ~ cl.mat %>% magrittr::extract(match(k, names(.))) %>% 
         purrr::map(evi_table, ref.cl = ref.cl), TRUE ~ NULL)
  4: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  5: eval(quote(`_fseq`(`_lhs`)), env, env)
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: `_fseq`(`_lhs`)
  8: freduce(value, `_function_list`)
  9: withVisible(function_list[[k]](value))
  10: function_list[[k]](value)
  ...
  46: asNamespace(ns)
  47: getNamespace(ns)
  48: loadNamespace(name)
  49: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  50: asNamespace(ns)
  51: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  52: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  53: asNamespace(ns)
  54: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  55: stop(sprintf(msg, sQuote(package), paste(sQuote(bad), collapse = ", ")), domain = NA, 
         call. = FALSE)
  
  Selecting k and imputing non-clustered cases
  Computing consensus functions
  Diverse Cluster Ensemble Completed
  Selecting k and imputing non-clustered cases
  Computing consensus functions
  Diverse Cluster Ensemble Completed
  Selecting k and imputing non-clustered cases
  -- 7. Error: algorithm vs internal index heatmap works (@test-dice.R#52)  ------
  Function found when exporting methods from the namespace 'dimRed' which is not S4 generic: 'nrow'
  1: dice(hgsc, nk = 4, reps = 3, algorithms = "hc", cons.funs = "kmodes", ref.cl = ref.cl, 
         evaluate = FALSE, plot = TRUE) at testthat/test-dice.R:52
  2: consensus_evaluate(data = data, Eknn, ref.cl = ref.cl, k.method = k.method, trim = trim, 
         reweigh = reweigh, n = n)
  3: ref.cl %>% purrr::when(!is.null(.) ~ cl.mat %>% magrittr::extract(match(k, names(.))) %>% 
         purrr::map(evi_table, ref.cl = ref.cl), TRUE ~ NULL)
  4: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  5: eval(quote(`_fseq`(`_lhs`)), env, env)
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: `_fseq`(`_lhs`)
  8: freduce(value, `_function_list`)
  9: withVisible(function_list[[k]](value))
  10: function_list[[k]](value)
  ...
  46: asNamespace(ns)
  47: getNamespace(ns)
  48: loadNamespace(name)
  49: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  50: asNamespace(ns)
  51: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  52: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  53: asNamespace(ns)
  54: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  55: stop(sprintf(msg, sQuote(package), paste(sQuote(bad), collapse = ", ")), domain = NA, 
         call. = FALSE)
  
  -- 8. Failure: error if different number of unique labels (@test-external_validi
  `ev_confmat(x, y1)` threw an error.
  Message: Function found when exporting methods from the namespace 'dimRed' which is not S4 generic: 'nrow'
  Class:   simpleError/error/condition
  
  -- 9. Error: conventional and robust options reduce dimension but center/scale (
  Function found when exporting methods from the namespace 'dimRed' which is not S4 generic: 'nrow'
  1: prepare_data(hgsc, type = "robust") at testthat/test-prepare_data.R:13
  2: quantable::robustscale
  3: getExportedValue(pkg, name)
  4: asNamespace(ns)
  5: getNamespace(ns)
  6: loadNamespace(name)
  7: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  8: asNamespace(ns)
  9: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  10: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  11: asNamespace(ns)
  12: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  13: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), 
         i[[2L]], from = package)
  14: asNamespace(ns)
  15: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  16: stop(sprintf(msg, sQuote(package), paste(sQuote(bad), collapse = ", ")), domain = NA, 
         call. = FALSE)
  
  == testthat results  ===========================================================
  OK: 153 SKIPPED: 0 FAILED: 9
  1. Error: evaluation works with reference class and can plot (@test-consensus_combine.R#24) 
  2. Error: trimming (potentially) removes algorithms (@test-consensus_combine.R#41) 
  3. Error: reweighing (potentially) replicates each slice of algorithm (@test-consensus_combine.R#48) 
  4. Error: dice works with multiple algorithms, consensus funs, trimming, and
            reference class (@test-dice.R#18) 
  5. Error: single algorithm and single consensus return same results (@test-dice.R#27) 
  6. Error: indices slot returns NULL if evaluate specified as FALSE (@test-dice.R#34) 
  7. Error: algorithm vs internal index heatmap works (@test-dice.R#52) 
  8. Failure: error if different number of unique labels (@test-external_validity.R#13) 
  9. Error: conventional and robust options reduce dimension but center/scale (@test-prepare_data.R#13) 
  
  Error: testthat unit tests failed
  Execution halted