sentopics_date | R Documentation |
Extract or replace the internal dates of a sentopicmodel
. The
internal dates are used to create time series using the functions
sentiment_series()
or sentiment_topics()
. Dates should be provided by
using sentopics_date(x) <- value
or by storing a '.date' docvars in
the tokens object used to create the model.
sentopics_date(x, include_docvars = FALSE)
sentopics_date(x) <- value
x |
a |
include_docvars |
if |
value |
a |
a data.frame with the stored date per document.
The internal date is stored internally in the docvars of the topic
model. This means that dates may also be accessed through the docvars()
function, although this is discouraged.
Olivier Delmarcelle
Other sentopics helpers:
sentopics_labels()
,
sentopics_sentiment()
# example dataset already contains ".date" docvar
docvars(ECB_press_conferences_tokens)
# dates are automatically stored in the sentopicmodel object
lda <- LDA(ECB_press_conferences_tokens)
sentopics_date(lda)
# dates can be removed or modified by the assignment operator
sentopics_date(lda) <- NULL
sentopics_date(lda) <- docvars(ECB_press_conferences_tokens, ".date")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.