| uncombine {sentimentr} | R Documentation |
Ungroup a sentiment_by Object to the Sentence Level
Description
Ungroup a sentiment_by object, stretching to the element_id and
sentence_id levels.
Usage
uncombine(x, ...)
Arguments
x |
A |
... |
Ignored. |
Value
Returns a data.table with grouping variables plus:
element_id - The id number of the original vector passed to
sentimentword_count - Word count
summed by grouping variablesd - Standard deviation (
sd) of the sentiment/polarity score by grouping variableave_sentiment - Sentiment/polarity score
meanaverage by grouping variable
Examples
mytext <- c(
'do you like it? But I hate really bad dogs',
'I am the best friend.',
"Do you really like it? I'm not happy"
)
mytext <- get_sentences(mytext)
(x <- sentiment_by(mytext))
uncombine(x)
## Not run:
(y <- with(
presidential_debates_2012,
sentiment_by(
text.var = get_sentences(dialogue),
by = list(person, time)
)
))
uncombine(y)
## End(Not run)
[Package sentimentr version 2.9.0 Index]