uncombine: Ungroup a 'sentiment_by' Object to the Sentence Level

Description Usage Arguments Value Examples

View source: R/uncombine.R

Description

Ungroup a sentiment_by object, stretching to the element_id and sentence_id levels.

Usage

1

Arguments

x

A sentiment_by object.

...

Ignored.

Value

Returns a data.table with grouping variables plus:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
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)

sentimentr documentation built on Oct. 12, 2021, 9:06 a.m.