Produce a single row of a DocumentTermMatrix.

document_term_vector(corpus, document)

# S3 method for corpus
document_term_vector(corpus, document)

Arguments

corpus

A corpus, as returned vy corpus.

document

Index of document within the corpus.

Examples

# NOT RUN {
init_textanalysis()

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

corpus <- corpus(doc1, doc2)

update_lexicon(corpus)
document_term_vector(corpus)
# }