This function creates a term-frequency (TF) scaling matrix from a document-term matrix.
get_tf(dtm, norm = c("l1", "l2"))
a document-term matrix of class dgCMatrix
or
dgTMatrix
.
character
the method used to normalize term vectors.
"l1"
by default, i.e., scale by the number of words in the document.
ddiMatrix
TF scaling diagonal sparse matrix.