Running ‘testthat.R’ [15s/20s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(propr)
  > 
  > test_check("propr")
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  propr
   --- call from context --- 
  propr(counts, metric = "phs", ...)
   --- call from argument --- 
  if (class(counts) == "data.frame") counts <- as.matrix(counts)
   --- R stacktrace ---
  where 1: propr(counts, metric = "phs", ...)
  where 2: phis(mail)
  where 3: as.vector(phis(mail)@matrix)
  where 4: eval_bare(expr, quo_get_env(quo))
  where 5: quasi_label(enquo(expected), expected.label, arg = "expected")
  where 6 at testthat/test-aldex2propr.R#43: expect_equal(as.vector(propr.phisym(propr:::clrRcpp(mail[]))), 
      as.vector(phis(mail)@matrix))
  where 7: eval(code, test_env)
  where 8: eval(code, test_env)
  where 9: 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 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 12: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 13: doTryCatch(return(expr), name, parentenv, handler)
  where 14: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 15: tryCatchList(expr, classes, parentenv, handlers)
  where 16: 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 17: test_code(desc, code, env = parent.frame())
  where 18 at testthat/test-aldex2propr.R#41: test_that("aldex2propr matches codaSeq implementation", {
      expect_equal(as.vector(propr.phisym(propr:::clrRcpp(mail[]))), 
          as.vector(phis(mail)@matrix))
      expect_equal(sort(as.vector(codaSeq.phi(x)$phi)), sort(propr:::lltRcpp(aldex2propr(x, 
          how = "phis")@matrix)))
  })
  where 19: eval(code, test_env)
  where 20: eval(code, test_env)
  where 21: 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 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 24: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 25: doTryCatch(return(expr), name, parentenv, handler)
  where 26: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 27: tryCatchList(expr, classes, parentenv, handlers)
  where 28: 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 29: test_code(NULL, exprs, env)
  where 30: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 31: force(code)
  where 32: doWithOneRestart(return(expr), restart)
  where 33: withOneRestart(expr, restarts[[1L]])
  where 34: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 35: 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 36: FUN(X[[i]], ...)
  where 37: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 38: force(code)
  where 39: doWithOneRestart(return(expr), restart)
  where 40: withOneRestart(expr, restarts[[1L]])
  where 41: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 42: 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 43: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: 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 45: 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 46: test_check("propr")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (counts, metric = c("rho", "phi", "phs", "cor", "vlr"), 
      ivar = "clr", select, symmetrize = FALSE, alpha, p = 100) 
  {
      if (any(counts < 0)) 
          stop("Data may not contain negative measurements.")
      if (any(is.na(counts))) 
          stop("Remove NAs from 'counts' before proceeding.")
      if (class(counts) == "data.frame") 
          counts <- as.matrix(counts)
      if (is.null(colnames(counts))) 
          colnames(counts) <- as.character(1:ncol(counts))
      if (is.null(rownames(counts))) 
          rownames(counts) <- as.character(1:nrow(counts))
      if (missing(alpha)) {
          alpha <- NA
      }
      else {
          if (!is.na(alpha)) 
              if (alpha == 0) 
                  alpha <- NA
      }
      ct <- counts
      if (any(as.matrix(counts) == 0) & is.na(alpha)) {
          message("Alert: Replacing 0s with next smallest value.")
          zeros <- ct == 0
          ct[zeros] <- min(ct[!zeros])
      }
      use <- ivar2index(ct, ivar)
      if (is.na(alpha)) {
          message("Alert: Saving log-ratio transformed counts to @logratio.")
          logX <- log(ct)
          logSet <- logX[, use, drop = FALSE]
          ref <- rowMeans(logSet)
          lr <- sweep(logX, 1, ref, "-")
      }
      else {
          message("Alert: Saving alpha transformed counts to @logratio.")
          aX <- (ct^alpha - 1)/alpha
          aSet <- aX[, use, drop = FALSE]
          ref <- rowMeans(aSet)
          lr <- sweep(aX, 1, ref, "-")
      }
      if (!missing(select)) {
          message("Alert: Using 'select' disables permutation testing.")
          p <- 0
          if (!is.vector(select)) 
              stop("Provide 'select' as vector.")
          if (is.character(select)) 
              select <- match(select, colnames(counts))
          if (any(is.na(select))) 
              stop("Some 'select' not in data.")
          counts <- counts[, select]
          ct <- ct[, select]
          lr <- lr[, select]
      }
      lrv <- lr2vlr(lr)
      metric <- metric[1]
      if (metric == "rho") {
          mat <- lr2rho(lr)
      }
      else if (metric == "phi") {
          mat <- lr2phi(lr)
          if (symmetrize) 
              symRcpp(mat)
      }
      else if (metric == "phs") {
          mat <- lr2phs(lr)
      }
      else if (metric == "cor") {
          mat <- stats::cor(lr)
      }
      else if (metric == "vlr") {
          mat <- lrv
      }
      else {
          stop("Provided 'metric' not recognized.")
      }
      result <- new("propr")
      result@counts <- as.data.frame(ct)
      if (!missing(alpha)) {
          result@alpha <- as.numeric(alpha)
      }
      else {
          result@alpha <- as.numeric(NA)
      }
      result@metric <- metric[1]
      result@ivar <- ivar
      result@logratio <- as.data.frame(lr)
      result@pairs <- vector("numeric")
      result@matrix <- mat
      colnames(result@matrix) <- colnames(result@logratio)
      rownames(result@matrix) <- colnames(result@logratio)
      result@permutes <- list(NULL)
      if (p > 0) {
          message("Alert: Fixing permutations to active random seed.")
          permutes <- vector("list", p)
          for (ins in 1:length(permutes)) permutes[[ins]] <- t(apply(ct, 
              1, sample))
          result@permutes <- permutes
      }
      labels <- labRcpp(ncol(lr))
      result@results <- data.frame(Partner = labels[[1]], Pair = labels[[2]], 
          lrv = lltRcpp(lrv), metric = factor(metric), alpha = factor(alpha), 
          propr = lltRcpp(mat))
      if (any(as.matrix(counts) == 0)) {
          message("Alert: Tabulating the presence of 0 counts.")
          result@results$Zeros <- ctzRcpp(as.matrix(counts))
      }
      message("Alert: Use '[' to index proportionality matrix.")
      message("Alert: Use 'updateCutoffs' to calculate FDR.")
      return(result)
  }
  <bytecode: 0x557a116f1100>
  <environment: namespace:propr>
   --- function search by body ---
  Function propr in namespace propr has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1