# NOT RUN {
# 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)
sento_measures <- sento_measures(corpusSample, l, ctr)
# plot sentiment measures
plot(sento_measures, "features")
# }
# NOT RUN {
# adjust appearance of plot
library("ggplot2")
p <- plot(sento_measures)
p <- p +
scale_x_date(name = "year", date_labels = "%Y") +
scale_y_continuous(name = "newName")
p
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab