Running examples in ‘stm-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: alignCorpus
> ### Title: Align the vocabulary of a new corpus to an old corpus
> ### Aliases: alignCorpus
> 
> ### ** Examples
> 
> #we process an original set that is just the first 100 documents
> temp<-textProcessor(documents=gadarian$open.ended.response[1:100],metadata=gadarian[1:100,])
Building corpus... 
Converting to Lower Case... 
Removing punctuation... 
Removing stopwords... 
Removing numbers... 
Stemming... 
Creating Output... 
> out <- prepDocuments(temp$documents, temp$vocab, temp$meta)
Removing 329 of 512 terms (329 of 1139 tokens) due to frequency 
Removing 2 Documents with No Words 
Your corpus now has 98 documents, 183 terms and 810 tokens.> set.seed(02138)
> #Maximum EM its is set low to make this run fast, run models to convergence!
> mod.out <- stm(out$documents, out$vocab, 3, prevalence=~treatment + s(pid_rep), 
+               data=out$meta, max.em.its=5)
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: stm(out$documents, out$vocab, 3, prevalence = ~treatment + s(pid_rep), 
    data = out$meta, max.em.its = 5)

 --- 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: 0x5600ca0c30d0>
<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