R/top.topic.documents.R

top.topic.documents <-
function (document_sums, num.documents = 20, alpha = 0.1) 
{
    normalized.sums <- t(document_sums + alpha)/colSums(document_sums + 
        alpha)
    apply(normalized.sums, 2, function(x) order(x, decreasing = TRUE)[1:num.documents])
}

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.