as.data.table.sento_measures: Get the sentiment measures

Description Usage Arguments Value Author(s) Examples

View source: R/sentomeasures_methods.R

Description

Extracts the sentiment measures data.table in either wide (by default) or long format.

Usage

1
2
## S3 method for class 'sento_measures'
as.data.table(x, keep.rownames = FALSE, format = "wide", ...)

Arguments

x

a sento_measures object created using sento_measures.

keep.rownames

see as.data.table.

format

a single character vector, one of c("wide", "long").

...

not used.

Value

The panel of sentiment measures under sento_measures[["measures"]], in wide or long format.

Author(s)

Samuel Borms

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data("usnews", package = "sentometrics")
data("list_lexicons", package = "sentometrics")
data("list_valence_shifters", package = "sentometrics")

sm <- sento_measures(sento_corpus(corpusdf = usnews[1:200, ]),
                     sento_lexicons(list_lexicons["LM_en"]),
                     ctr_agg(lag = 3))

data.table::as.data.table(sm)
data.table::as.data.table(sm, format = "long")

sentometrics documentation built on Aug. 18, 2021, 9:06 a.m.