Running ‘testthat.R’ [5s/8s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(CHNOSZ)
  CHNOSZ version 1.3.3 (2019-08-02)
  reset: creating "thermo" object
  obigt: loading default database with 1849 aqueous, 3372 total species
  > 
  > # as fix for https://github.com/hadley/testthat/issues/129, https://github.com/hadley/testthat/issues/144
  > # (since we use makeCluster() etc via palply)
  > Sys.setenv("R_TESTS" = "") 
  > 
  > test_check("CHNOSZ")
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  CHNOSZ
   --- call from context --- 
  put.basis(ispecies, logact)
   --- call from argument --- 
  if (class(try(solve(comp), silent = TRUE)) == "try-error") stop("singular stoichiometric matrix")
   --- R stacktrace ---
  where 1: put.basis(ispecies, logact)
  where 2: basis(species, logact)
  where 3: preset.basis(species[1])
  where 4 at testthat/test-affinity.R#10: basis("CHNOS")
  where 5: eval(code, test_env)
  where 6: eval(code, test_env)
  where 7: 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 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 10: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 11: doTryCatch(return(expr), name, parentenv, handler)
  where 12: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 13: tryCatchList(expr, classes, parentenv, handlers)
  where 14: 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 15: test_code(desc, code, env = parent.frame())
  where 16 at testthat/test-affinity.R#6: test_that("errors come as expected", {
      expect_error(affinity(iprotein = 7), "basis species are not defined")
      expect_error(affinity(iprotein = NA), "has some NA values")
      expect_error(affinity(iprotein = 0), "are not rownumbers")
      basis("CHNOS")
      expect_error(affinity(), "species have not been defined")
      species("CO2")
      expect_error(affinity(pe = c(-10, 10), pH = c(0, 14)), "pe.*does not match any basis species")
      expect_error(affinity(O2 = c(-80, -60), pH = c(0, 14)), "pH.*does not match any basis species")
  })
  where 17: eval(code, test_env)
  where 18: eval(code, test_env)
  where 19: 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 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 23: doTryCatch(return(expr), name, parentenv, handler)
  where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 25: tryCatchList(expr, classes, parentenv, handlers)
  where 26: 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 27: test_code(NULL, exprs, env)
  where 28: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 29: force(code)
  where 30: doWithOneRestart(return(expr), restart)
  where 31: withOneRestart(expr, restarts[[1L]])
  where 32: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 33: 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 34: FUN(X[[i]], ...)
  where 35: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 36: force(code)
  where 37: doWithOneRestart(return(expr), restart)
  where 38: withOneRestart(expr, restarts[[1L]])
  where 39: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 40: 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 41: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: 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 43: 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 44: test_check("CHNOSZ")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (ispecies, logact = rep(NA, length(ispecies))) 
  {
      thermo <- get("thermo", CHNOSZ)
      state <- thermo$obigt$state[ispecies]
      comp <- makeup(ispecies, count.zero = TRUE)
      comp <- sapply(comp, c)
      comp <- t(comp)
      rownames(comp) <- as.character(thermo$obigt$formula[ispecies])
      if ("(Z-1)" %in% rownames(comp)) 
          rownames(comp)[rownames(comp) == "(Z-1)"] <- "e-"
      if (nrow(comp) > ncol(comp)) {
          if ("Z" %in% colnames(comp)) 
              stop("the number of basis species is greater than the number of elements and charge")
          else stop("the number of basis species is greater than the number of elements")
      }
      if (nrow(comp) < ncol(comp)) {
          if ("Z" %in% colnames(comp)) 
              stop("the number of basis species is less than the number of elements and charge")
          else stop("the number of basis species is less than the number of elements")
      }
      if (class(try(solve(comp), silent = TRUE)) == "try-error") 
          stop("singular stoichiometric matrix")
      comp <- cbind(as.data.frame(comp), ispecies, logact, state, 
          stringsAsFactors = FALSE)
      thermo$basis <- comp
      assign("thermo", thermo, CHNOSZ)
      species(delete = TRUE)
      return(thermo$basis)
  }
  <bytecode: 0x560113cb2c38>
  <environment: namespace:CHNOSZ>
   --- function search by body ---
  Function put.basis in namespace CHNOSZ has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1