Description Usage Arguments Value See Also Examples
Run LDA on a Mallet instance
1 2 | modelToDataframe(topic.model, prepped_corpus, n.topics = n.topics,
num.topwords = 5, textcolname = "text", incCorpusText = TRUE)
|
topic.model |
topic.model usually taken from make_model, a Mallet object |
prepped_corpus |
data.frame usually taken from prep_corpus, a data.frame with fields for text, journal, date |
num.topwords |
numeric number of words to display on topic labels |
textcolname |
string the name of the text column from prepped_corpus |
incCorpusText |
logical whether or not to include the raw text data from prepped_corpus in the final data.frame to be output |
a data.frame of topic frequencies by document that we can analyze and graph
prep_corpus
, which creates the data.frame this function draws on
make_model
, which creates the mallet object this function uses
1 2 3 4 | date_vec <- date_vec
dataframe <- stripped_xmlData
marsden_journals <- make_model(dataframe, 10, journalVec = c("Blast", "Egoist", "Freewoman", "NewFreewoman"))
marz.df <- train_model(marsden_journals, dataframe, c("Blast", "Egoist", "Freewoman", "NewFreewoman"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.