Learn R Programming

textmineR (version 2.1.3)

GetVocabFromDtm: Reconstruct a text2vec::vocabulary object from a document term matrix.

Description

Reconstructs a text2vec::vocabulary object from a document term matrix. See create_vocabulary for more details.

Usage

GetVocabFromDtm(dtm)

Arguments

dtm

A document term matrix of class dgCMatrix

Value

Returns a text2vec::vocabulary object. See create_vocabulary for more details.

Examples

Run this code
# NOT RUN {
# Load a pre-formatted dtm 
data(nih_sample_dtm) 

vocab <- GetVocabFromDtm(dtm = nih_sample_dtm)

str(vocab)
# }

Run the code above in your browser using DataLab