From ea4a1140f0490e8d5bc07749f4bb28cf2d9f97a9 Mon Sep 17 00:00:00 2001 From: Lucky <66523959+l-ucky@users.noreply.github.com> Date: Thu, 24 Aug 2023 15:43:51 -0300 Subject: [PATCH] Update 4ChanScraperv2.R Added sentiment analysis --- 4ChanScraperv2.R | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/4ChanScraperv2.R b/4ChanScraperv2.R index 68ee00f..d8f64f7 100644 --- a/4ChanScraperv2.R +++ b/4ChanScraperv2.R @@ -326,6 +326,16 @@ tidy_pol_fixed2 %>% with(wordcloud(word, n, max.words = 100, random.order = FALSE, rot.per = 0.0, colors = brewer.pal(8, "Dark2"))) +# Sentiment analysis, and visuals with a bar grapoh. +# This will take a few minutes to process +# On my Ryzen 7 3700X, and 16Gb of RAM, it took about 5 minutes. +sentiment_tidy_pol_fixed_2 <- get_nrc_sentiment(tidy_pol_fixed2$word) + +barplot(colSums(sentiment_tidy_pol_fixed_2), + las = 2, + col = rainbow(10), + ylab = 'Count', + main = 'Pol Sentiment Scores') # Time to Save the Data timestamp <- format(Sys.time(), "%b %d %Y %X")