Running 'spelling.R' [0s/1s]
  Running 'testthat.R' [11s/13s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(stm)
  stm v1.3.4 successfully loaded. See ?stm for help. 
   Papers, resources, and other materials at structuraltopicmodel.com
  > 
  > test_check("stm")
  Building corpus... 
  Converting to Lower Case... 
  Removing punctuation... 
  Removing stopwords... 
  Removing numbers... 
  Stemming... 
  Creating Output... 
  Removed 1098 of 1102 terms (3659 of 4143 tokens) due to sparselevel of 0.8 
  Removing 2 of 4 terms (223 of 377 tokens) due to frequency 
  Removing 117 Documents with No Words 
  Your corpus now has 135 documents, 2 terms and 154 tokens.Beginning Spectral Initialization 
  	 Calculating the gram matrix...
  	 Finding anchor words...
   	...
  	 Recovering initialization...
   	...........
  Initialization complete.
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  stm
   --- call from context --- 
  estep(documents = documents, beta.index = betaindex, update.mu = (!is.null(mu$gamma)), 
      beta$beta, lambda, mu$mu, sigma, verbose)
   --- call from argument --- 
  if (class(sigobj) == "try-error") {
      sigmaentropy <- (0.5 * determinant(sigma, logarithm = TRUE)$modulus[1])
      siginv <- solve(sigma)
  } else {
      sigmaentropy <- sum(log(diag(sigobj)))
      siginv <- chol2inv(sigobj)
  }
   --- R stacktrace ---
  where 1: estep(documents = documents, beta.index = betaindex, update.mu = (!is.null(mu$gamma)), 
      beta$beta, lambda, mu$mu, sigma, verbose)
  where 2: stm.control(documents, vocab, settings, model)
  where 3 at testthat/test-quanteda-stm.R#13: stm(gadarian_dfm, K = 3, prevalence = ~treatment + s(pid_rep), 
      data = docvars(gadarian_corpus), max.em.its = 2)
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: 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 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: 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 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test-quanteda-stm.R#5: test_that("Test that stm works on a quanteda dfm", {
      require(quanteda)
      if (utils::compareVersion(as.character(utils::packageVersion("quanteda")), 
          "0.9.9-31") >= 0) {
          gadarian_corpus <- corpus(gadarian, text_field = "open.ended.response")
          gadarian_dfm <- dfm(gadarian_corpus, remove = stopwords("english"), 
              stem = TRUE)
          set.seed(10012)
          stm_from_dfm <- stm(gadarian_dfm, K = 3, prevalence = ~treatment + 
              s(pid_rep), data = docvars(gadarian_corpus), max.em.its = 2)
          expect_identical(class(stm_from_dfm), "STM")
      }
      else {
          expect_identical("STM", "STM")
      }
  })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: 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 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: 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 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: 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 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: 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 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: 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 42: 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 43: test_check("stm")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (documents, beta.index, update.mu, beta, lambda.old, 
      mu, sigma, verbose) 
  {
      V <- ncol(beta[[1]])
      K <- nrow(beta[[1]])
      N <- length(documents)
      A <- length(beta)
      ctevery <- ifelse(N > 100, floor(N/100), 1)
      if (!update.mu) 
          mu.i <- as.numeric(mu)
      sigma.ss <- diag(0, nrow = (K - 1))
      beta.ss <- vector(mode = "list", length = A)
      for (i in 1:A) {
          beta.ss[[i]] <- matrix(0, nrow = K, ncol = V)
      }
      bound <- vector(length = N)
      lambda <- vector("list", length = N)
      sigobj <- try(chol.default(sigma), silent = TRUE)
      if (class(sigobj) == "try-error") {
          sigmaentropy <- (0.5 * determinant(sigma, logarithm = TRUE)$modulus[1])
          siginv <- solve(sigma)
      }
      else {
          sigmaentropy <- sum(log(diag(sigobj)))
          siginv <- chol2inv(sigobj)
      }
      for (i in 1:N) {
          doc <- documents[[i]]
          words <- doc[1, ]
          aspect <- beta.index[i]
          init <- lambda.old[i, ]
          if (update.mu) 
              mu.i <- mu[, i]
          beta.i <- beta[[aspect]][, words, drop = FALSE]
          doc.results <- logisticnormalcpp(eta = init, mu = mu.i, 
              siginv = siginv, beta = beta.i, doc = doc, sigmaentropy = sigmaentropy)
          sigma.ss <- sigma.ss + doc.results$eta$nu
          beta.ss[[aspect]][, words] <- doc.results$phis + beta.ss[[aspect]][, 
              words]
          bound[i] <- doc.results$bound
          lambda[[i]] <- c(doc.results$eta$lambda)
          if (verbose && i%%ctevery == 0) 
              cat(".")
      }
      if (verbose) 
          cat("\n")
      lambda <- do.call(rbind, lambda)
      return(list(sigma = sigma.ss, beta = beta.ss, bound = bound, 
          lambda = lambda))
  }
  <bytecode: 0x48f0fe0>
  <environment: namespace:stm>
   --- function search by body ---
  Function estep in namespace stm has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Fatal error: the condition has length > 1