R/lda.cvb0.R

lda.cvb0 <- function(documents, K, vocab, num.iterations, alpha, eta, trace = 0L) {
    retval <- structure(
      .Call(
        "cvb0", 
        documents, 
        as.integer(K), 
        as.integer(length(vocab)), 
        as.integer(num.iterations), 
        as.double(alpha), 
        as.double(eta),
        as.integer(trace)
      ), 
      names = c(
        "assignments", 
        "topics", 
        "topic_sums", 
        "document_sums"
      )
    )
    colnames(retval$topics) <- vocab
    retval
}

Try the lda package in your browser

Any scripts or data that you put into this service are public.

lda documentation built on May 1, 2019, 10:34 p.m.