Running 'testthat.R' [13s/15s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(DGCA)
  
  > test_check("DGCA")
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  DGCA
   --- call from context --- 
  getCors(cbind(t(simData_A2), t(simData_B2)), design_mat)
   --- call from argument --- 
  if (!class(inputMat) %in% c("data.frame", "matrix")) stop("Input data should be either data.frame or matrix.\n")
   --- R stacktrace ---
  where 1 at testthat/test-dCorrs.R#50: getCors(cbind(t(simData_A2), t(simData_B2)), design_mat)
  where 2: eval(code, test_env)
  where 3: eval(code, test_env)
  where 4: 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 5: doTryCatch(return(expr), name, parentenv, handler)
  where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 7: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 10: tryCatchList(expr, classes, parentenv, handlers)
  where 11: 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 12: test_code(desc, code, env = parent.frame())
  where 13 at testthat/test-dCorrs.R#26: test_that("pairwiseDCor works", {
      simData_A2 = simData_A
      simData_B2 = simData_B
      simData_A2[, 1] = c(2, 1.1, rep(1, times = (nrows - 2)))
      simData_A2[, 2] = c(0, rep(1, times = (nrows - 1)))
      simData_B2[, 1] = c(2, 1.1, rep(1, times = (nrows - 2)))
      simData_B2[, 2] = c(2, rep(1, times = (nrows - 1)))
      expect_equal(round(matCorr(simData_B2, corrType = "pearson")[1, 
          2], digits = 2), 0.99)
      expect_equal(round(matCorr(simData_B2, corrType = "spearman")[1, 
          2], digits = 2), 0.76)
      fac = factor(c(rep("A", times = nrow(simData_A2)), rep("B", 
          times = nrow(simData_B2))))
      design_mat = model.matrix(~fac + 0)
      cor_res = getCors(cbind(t(simData_A2), t(simData_B2)), design_mat)
      PDC = pairwiseDCor(cor_res, compare = c("facA", "facB"))
      expect_equal(round(slot(PDC, "ZDiff")[1, 2], 0), 9)
      expect_equal(round(log(slot(PDC, "PValDiff")[1, 2], 10), 
          0), -18)
      expect_error(pairwiseDCor(cor_res, compare = c("foo", "bar")), 
          "names are not in")
      dc_slice = dcTopPairs(PDC, 40, classify = FALSE)
      expect_equal(dc_slice[1, "Gene2"], col_names[2])
      expect_equal(round(dc_slice[1, "zScoreDiff"], 0), 9)
      expect_equal(round(log(dc_slice[1, "pValDiff"], 10), 0), 
          -18)
      dc_slice_class = dcTopPairs(PDC, 40, classify = TRUE)
      expect_equal(as.character(dc_slice_class[1, "Classes"]), 
          "-/+")
      dc_top = dcTopPairs(PDC, nPairs = 30)
      expect_equal(as.character(dc_top[1, c("Gene1", "Gene2")]), 
          c(col_names[1], col_names[2]))
  })
  where 14: eval(code, test_env)
  where 15: eval(code, test_env)
  where 16: 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 17: doTryCatch(return(expr), name, parentenv, handler)
  where 18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 19: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 22: tryCatchList(expr, classes, parentenv, handlers)
  where 23: 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 24: test_code(NULL, exprs, env)
  where 25: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 26: force(code)
  where 27: doWithOneRestart(return(expr), restart)
  where 28: withOneRestart(expr, restarts[[1L]])
  where 29: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 30: 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 31: FUN(X[[i]], ...)
  where 32: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 33: force(code)
  where 34: doWithOneRestart(return(expr), restart)
  where 35: withOneRestart(expr, restarts[[1L]])
  where 36: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 37: 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 38: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 39: 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 40: 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 41: test_check("DGCA")
  
   --- value of length: 2 type: logical ---
  [1] FALSE  TRUE
   --- function from context --- 
  function (inputMat, design, inputMatB = NULL, impute = FALSE, 
      corrType = "pearson") 
  {
      SAF = getOption("stringsAsFactors")
      on.exit(options(stringsAsFactors = SAF))
      options(stringsAsFactors = FALSE)
      if (!corrType %in% c("pearson", "spearman")) 
          stop("corrType should be one of \"pearson\" or \"spearman\".\n")
      if (!class(inputMat) %in% c("data.frame", "matrix")) 
          stop("Input data should be either data.frame or matrix.\n")
      if (!mode(design) == "numeric") 
          stop("Design matrix must be numeric.\n")
      if (!all(design %in% c(0, 1))) 
          stop("Design matrix must be made up of 0's and 1's.\n")
      if (nrow(design) != ncol(inputMat)) 
          stop("The number of rows in the design matrix must be equal to the number of columns in the input matrix.")
      if (!is.null(inputMatB)) {
          if (nrow(design) != ncol(inputMatB)) 
              stop("The number of rows in the design matrix must be equal to the number of columns in the input matrix.")
          if (!class(inputMatB) %in% c("data.frame", "matrix")) 
              stop("Input data should be either data.frame or matrix.\n")
      }
      if (impute == TRUE) {
          if (!requireNamespace("impute", quietly = TRUE)) {
              stop("The R package impute is needed for the impute knn function to work. Please install it.", 
                  call. = FALSE)
          }
          if (any(is.na(inputMat))) {
              imputed = impute::impute.knn(as.matrix(inputMat))
              inputMat = imputed$data
          }
          else {
              message("No NA values in input, so ignoring impute = TRUE.\n")
          }
          if (!is.null(inputMatB)) {
              if (any(is.na(inputMatB))) {
                  imputedB = impute::impute.knn(as.matrix(inputMatB))
                  inputMatB = imputedB$data
              }
              else {
                  message("No NA values in secondary input, so ignoring impute = TRUE.\n")
              }
          }
      }
      if (is.null(inputMatB)) {
          designRes = getGroupsFromDesign(inputMat, design)
          groupList = designRes[[1]]
          groupMatLists = as.list(rep(NA, length(groupList)))
          names(groupMatLists) = designRes[[2]]
          for (i in 1:length(groupList)) {
              corr = matCorr(t(groupList[[i]]), corrType = corrType)
              nsamp = matNSamp(t(groupList[[i]]), impute = impute)
              pval = matCorSig(corr, nsamp)
              groupMatLists[[i]] = list(corrs = corr, pvals = pval, 
                  nsamps = nsamp)
          }
      }
      if (!is.null(inputMatB)) {
          designRes = getGroupsFromDesign(inputMat = inputMat, 
              design = design, inputMatB = inputMatB, secondMat = TRUE)
          groupListA = designRes[[1]]
          groupListB = designRes[[2]]
          groupMatLists = as.list(rep(NA, length(groupListA)))
          names(groupMatLists) = designRes[[3]]
          for (i in 1:length(groupListA)) {
              corr = matCorr(matA = t(groupListA[[i]]), corrType = corrType, 
                  matB = t(groupListB[[i]]), secondMat = TRUE)
              nsamp = matNSamp(matA = t(groupListA[[i]]), impute = impute, 
                  matB = t(groupListB[[i]]), secondMat = TRUE)
              pval = matCorSig(corr, nsamp, secondMat = TRUE)
              groupMatLists[[i]] = list(corrs = corr, pvals = pval, 
                  nsamps = nsamp)
          }
      }
      options = c(corrType)
      names(options) = c("corrType")
      corMatsObj = new("corMats", corMatList = groupMatLists, design = design, 
          options = options)
      return(corMatsObj)
  }
  <bytecode: 0x1015dbd0>
  <environment: namespace:DGCA>
   --- function search by body ---
  Function getCors in namespace DGCA has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1