Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dtm_reverse

Inverse operation of the document_term_matrix function


Description

Inverse operation of the document_term_matrix function. Creates frequency table which contains 1 row per document/term

Usage

dtm_reverse(x)

Arguments

x

an object as returned by document_term_matrix

Value

a data.frame with columns doc_id, term and freq where freq is just the value in each cell of the x

See Also

Examples

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)

udpipe

Tokenization, Parts of Speech Tagging, Lemmatization and Dependency Parsing with the 'UDPipe' 'NLP' Toolkit

v0.8.5
MPL-2.0
Authors
Jan Wijffels [aut, cre, cph], BNOSAC [cph], Institute of Formal and Applied Linguistics, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic [cph], Milan Straka [ctb, cph], Jana Straková [ctb, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.