Running 'spelling.R' [0s/1s]
  Running 'testthat.R' [46s/133s]
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: 0x5b1b8a8>
  <environment: namespace:stm>
   --- function search by body ---
  Function estep in namespace stm has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 1. Error: Test that stm works on a quanteda dfm (@test-quanteda-stm.R#13)  --
  the condition has length > 1
  Backtrace:
   1. stm::stm(...)
   2. stm:::stm.control(documents, vocab, settings, model)
   3. stm:::estep(...)
  
  Building corpus... 
  Converting to Lower Case... 
  Removing punctuation... 
  Removing stopwords... 
  Removing numbers... 
  Stemming... 
  Creating Output... 
  Removing 640 of 1102 terms (640 of 3789 tokens) due to frequency 
  Your corpus now has 341 documents, 462 terms and 3149 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#37: stm(docs, vocab, 3, prevalence = ~treatment + s(pid_rep), data = meta, 
      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#26: test_that("Test that stm works on a classic stm object structure", 
      {
          temp <- textProcessor(documents = gadarian$open.ended.response, 
              metadata = gadarian)
          meta <- temp$meta
          vocab <- temp$vocab
          docs <- temp$documents
          out <- prepDocuments(docs, vocab, meta)
          docs <- out$documents
          vocab <- out$vocab
          meta <- out$meta
          set.seed(10012)
          stm_from_stmclassic <- stm(docs, vocab, 3, prevalence = ~treatment + 
              s(pid_rep), data = meta, max.em.its = 2)
          expect_identical(class(stm_from_stmclassic), "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: 0x5b1b8a8>
  <environment: namespace:stm>
   --- function search by body ---
  Function estep in namespace stm has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 2. Error: Test that stm works on a classic stm object structure (@test-quante
  the condition has length > 1
  Backtrace:
   1. stm::stm(...)
   2. stm:::stm.control(documents, vocab, settings, model)
   3. stm:::estep(...)
  
  Beginning Random Initialization 
   ----------- 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-stm-options.R#5: stm(poliblog5k.docs, poliblog5k.voc, K = 3, max.em.its = 1, init.type = "Random")
  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-stm-options.R#4: test_that("Test that CTM stm works", {
      test <- stm(poliblog5k.docs, poliblog5k.voc, K = 3, max.em.its = 1, 
          init.type = "Random")
      expect_identical(class(test), "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: 0x5b1b8a8>
  <environment: namespace:stm>
   --- function search by body ---
  Function estep in namespace stm has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 3. Error: Test that CTM stm works (@test-stm-options.R#5)  ------------------
  the condition has length > 1
  Backtrace:
   1. stm::stm(...)
   2. stm:::stm.control(documents, vocab, settings, model)
   3. stm:::estep(...)
  
  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-stm-options.R#10: stm(poliblog5k.docs, poliblog5k.voc, K = 3, max.em.its = 1, init.type = "Spectral")
  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-stm-options.R#9: test_that("Test that spectral init works", {
      test <- stm(poliblog5k.docs, poliblog5k.voc, K = 3, max.em.its = 1, 
          init.type = "Spectral")
      expect_identical(class(test), "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: 0x5b1b8a8>
  <environment: namespace:stm>
   --- function search by body ---
  Function estep in namespace stm has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 4. Error: Test that spectral init works (@test-stm-options.R#10)  -----------
  the condition has length > 1
  Backtrace:
   1. stm::stm(...)
   2. stm:::stm.control(documents, vocab, settings, model)
   3. stm:::estep(...)
  
  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-stm-options.R#15: stm(poliblog5k.docs, poliblog5k.voc, prevalence = ~s(day) * blog, 
      K = 3, max.em.its = 2, init.type = "Spectral", data = poliblog5k.meta)
  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-stm-options.R#14: test_that("Test that Prevalence works", {
      test <- stm(poliblog5k.docs, poliblog5k.voc, prevalence = ~s(day) * 
          blog, K = 3, max.em.its = 2, init.type = "Spectral", 
          data = poliblog5k.meta)
      expect_identical(class(test), "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: 0x5b1b8a8>
  <environment: namespace:stm>
   --- function search by body ---
  Function estep in namespace stm has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 5. Error: Test that Prevalence works (@test-stm-options.R#15)  --------------
  the condition has length > 1
  Backtrace:
   1. stm::stm(...)
   2. stm:::stm.control(documents, vocab, settings, model)
   3. stm:::estep(...)
  
  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-stm-options.R#22: stm(poliblog5k.docs, poliblog5k.voc, content = ~blog, K = 3, 
      max.em.its = 2, init.type = "Spectral", data = poliblog5k.meta)
  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-stm-options.R#21: test_that("Test that Content works", {
      test <- stm(poliblog5k.docs, poliblog5k.voc, content = ~blog, 
          K = 3, max.em.its = 2, init.type = "Spectral", data = poliblog5k.meta)
      expect_identical(class(test), "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: 0x5b1b8a8>
  <environment: namespace:stm>
   --- function search by body ---
  Function estep in namespace stm has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 6. Error: Test that Content works (@test-stm-options.R#22)  -----------------
  the condition has length > 1
  Backtrace:
   1. stm::stm(...)
   2. stm:::stm.control(documents, vocab, settings, model)
   3. stm:::estep(...)
  
  Beginning Random Initialization 
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  stm
   --- call from context --- 
  estep(documents = gdocs, beta.index = gbetaindex, update.mu = (!is.null(mu$gamma)), 
      beta$beta, glambda, gmu, 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 = gdocs, beta.index = gbetaindex, update.mu = (!is.null(mu$gamma)), 
      beta$beta, glambda, gmu, sigma, verbose)
  where 2: stm.control(documents, vocab, settings, model)
  where 3 at testthat/test-stm-options.R#29: stm(poliblog5k.docs, poliblog5k.voc, K = 3, init.type = "Random", 
      ngroups = 2, 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-stm-options.R#28: test_that("Test that ngroups works", {
      test <- stm(poliblog5k.docs, poliblog5k.voc, K = 3, init.type = "Random", 
          ngroups = 2, max.em.its = 2)
      expect_identical(class(test), "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: 0x5b1b8a8>
  <environment: namespace:stm>
   --- function search by body ---
  Function estep in namespace stm has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 7. Error: Test that ngroups works (@test-stm-options.R#29)  -----------------
  the condition has length > 1
  Backtrace:
   1. stm::stm(...)
   2. stm:::stm.control(documents, vocab, settings, model)
   3. stm:::estep(...)
  
  == testthat results  ===========================================================
  [ OK: 3 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 7 ]
  1. Error: Test that stm works on a quanteda dfm (@test-quanteda-stm.R#13) 
  2. Error: Test that stm works on a classic stm object structure (@test-quanteda-stm.R#37) 
  3. Error: Test that CTM stm works (@test-stm-options.R#5) 
  4. Error: Test that spectral init works (@test-stm-options.R#10) 
  5. Error: Test that Prevalence works (@test-stm-options.R#15) 
  6. Error: Test that Content works (@test-stm-options.R#22) 
  7. Error: Test that ngroups works (@test-stm-options.R#29) 
  
  Error: testthat unit tests failed
  Execution halted