Description Usage Arguments Value Author(s) Examples
View source: R/sentomeasures_methods.R
Plotting method that shows all sentiment measures from the provided sento_measures
object in one plot, or the average along one of the lexicons, features and time weighting dimensions.
1 2 |
x |
a |
group |
a value from |
... |
not used. |
Returns a simple ggplot
object, which can be added onto (or to alter its default elements) by using
the +
operator (see example). By default, a legend is positioned at the top if there are at maximum twelve line
graphs plotted and group
is different from "all"
.
Samuel Borms
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # construct a sento_measures object to start with
corpus <- sento_corpus(corpusdf = sentometrics::usnews)
corpusSample <- quanteda::corpus_sample(corpus, size = 500)
l <- sento_lexicons(sentometrics::list_lexicons[c("LM_en")],
sentometrics::list_valence_shifters[["en"]])
ctr <- ctr_agg(howTime = c("equal_weight", "linear"), by = "month", lag = 3)
sm <- sento_measures(corpusSample, l, ctr)
# plot sentiment measures
plot(sm, "features")
## Not run:
# adjust appearance of plot
library("ggplot2")
p <- plot(sm)
p <- p +
scale_x_date(name = "year", date_labels = "%Y") +
scale_y_continuous(name = "newName")
p
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.