dtm_reverse | R Documentation |
Inverse operation of the document_term_matrix
function.
Creates frequency table which contains 1 row per document/term
dtm_reverse(x)
x |
an object as returned by |
a data.frame with columns doc_id, term and freq where freq is just the value in each
cell of the x
document_term_matrix
x <- data.frame( doc_id = c(1, 1, 2, 3, 4), term = c("A", "C", "Z", "X", "G"), freq = c(1, 5, 7, 10, 0)) dtm <- document_term_matrix(x) dtm_reverse(dtm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.