Running examples in 'maptpx-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: predict.topics
> ### Title: topic predict
> ### Aliases: predict.topics
> 
> ### ** Examples
> 
> 
> ## Simulate some data
> omega <- t(rdir(500, rep(1/10,10)))
> theta <- rdir(10, rep(1/1000,1000))
> Q <- omega%*%t(theta)
> counts <- matrix(ncol=1000, nrow=500)
> totals <- rpois(500, 200)
> for(i in 1:500){ counts[i,] <- rmultinom(1, size=totals[i], prob=Q[i,]) }
> 
> ## predict omega given theta
> W <- predict.topics( theta, counts )
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
maptpx
 --- call from context --- 
predict.topics(theta, counts)
 --- call from argument --- 
if (!(class(object) %in% c("topics", "matrix"))) {
    stop("object class must be `topics' or 'matrix'.")
}
 --- R stacktrace ---
where 1: predict.topics(theta, counts)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (object, newcounts, loglhd = FALSE, ...) 
{
    if (is.vector(newcounts)) {
        newcounts <- matrix(newcounts, nrow = 1)
    }
    if (class(newcounts)[1] == "TermDocumentMatrix") {
        newcounts <- t(newcounts)
    }
    X <- as.simple_triplet_matrix(newcounts)
    if (!(class(object) %in% c("topics", "matrix"))) {
        stop("object class must be `topics' or 'matrix'.")
    }
    if (class(object) == "topics") {
        theta <- object$theta
        if (nrow(theta) != ncol(X)) {
            stop("Dimension mismatch: nrow(theta) != ncol(X)")
        }
        if (nrow(object$X) != nrow(object$omega)) {
            Q <- matrix(tpxMixQ(X, omega = object$omega, theta = theta, 
                ...)$lQ, ncol = ncol(theta))
            return((1:ncol(theta))[apply(Q, 1, which.max)])
        }
    }
    else {
        theta <- object
    }
    start <- tpxOmegaStart(X = X, theta = theta)
    doc <- c(0, cumsum(as.double(table(factor(X$i, levels = c(1:nrow(X)))))))
    xvo <- X$v[order(X$i)]
    wrd <- X$j[order(X$i)] - 1
    W <- tpxweights(n = nrow(X), p = ncol(X), xvo = xvo, wrd = wrd, 
        doc = doc, start = start, theta = theta, ...)
    if (loglhd) {
        L <- sum(X$v * log(tpxQ(theta = theta, omega = W, doc = X$i, 
            wrd = X$j)))
        return(list(W = W, L = L))
    }
    else {
        return(W)
    }
}
<bytecode: 0x324bdf8>
<environment: namespace:maptpx>
 --- function search by body ---
Function predict.topics in namespace maptpx has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (!(class(object) %in% c("topics", "matrix"))) { : 
  the condition has length > 1
Calls: predict.topics
Execution halted