Compute term-frequency.

tf(dtm)

# S3 method for dtm
tf(dtm)

# S3 method for JuliaObject
tf(dtm)

Arguments

dtm

An object of class document_term_matrix as returned by document_term_matrix.

Examples

# NOT RUN {
init_textanalysis()

# build document
doc1 <- string_document("First document.")
doc2 <- string_document("Second document.")

corpus <- corpus(doc1, doc2)

update_lexicon(corpus)
m <- document_term_matrix(corpus)
tf(m)
# }