sentopics_date {sentopics} | R Documentation |
Internal date
Description
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.
Usage
sentopics_date(x, include_docvars = FALSE)
sentopics_date(x) <- value
Arguments
x |
a |
include_docvars |
if |
value |
a |
Value
a data.frame with the stored date per document.
Note
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.
Author(s)
Olivier Delmarcelle
See Also
Other sentopics helpers:
sentopics_labels()
,
sentopics_sentiment()
Examples
# 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")