Description Usage Arguments Value Examples
View source: R/computeFrequencies.R
Generate the Normalized Frequency table from textual data input.
1 | computeFrequencies(corpus, sentimentWord, shifterWord, clusterSize = 1)
|
corpus |
corpus with column |
sentimentWord |
Vector of words used for computing the sentiment. |
shifterWord |
Matrix with element |
clusterSize |
Scalar indicating the window in which valance shifting words have an influence. |
A list with the following elements:
docID: unique document ID.
regID: regression ID.
loc: location of the sentiment word within the texts.
word: sentiment word.
shift: shigt coefficient modifying the sentiment word.
NormalizedFrequency: frequency of word normalized by number of token in each text
NormalizedFrequencyPerRegID: Normalzied Frequency normalized by the number of documents per each regression ID.
1 2 3 4 5 6 7 8 9 | # Load example data
data("corpus", package = "GWP")
# Setup the lexicons
sentimentWord <- sentometrics::list_lexicons$LM_en$x
shifterWord <- sentometrics::list_valence_shifters$en[, c("x", "y")]
# Generate the frequency data
frequencies <- computeFrequencies(corpus, sentimentWord, shifterWord, clusterSize = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.