MENU

Fun & Interesting

Introduction to Text Analysis in R

David Caughlin 11,853 5 years ago
Video Not Working? Fix It Now

This R tutorial provides a basic introduction to one of the easier forms of text analysis to learn -- lexicon-based sentiment analysis. This tutorial is inspired by Silge and Robinson's "Text Mining in R: A Tidy Approach," which you can find here: https://www.tidytextmining.com/. March 28, 2022: Due to changes in tidytext package, the following steps need to be augmented/altered: + First, when installing the tidytext package, be sure to also install the stopwords package; doing so will allow you to use the get_stopwords function from tidytext. install.packages("stopwords") + To access the AFINN dictionary, you will need to install the textdata package. install.packages("textdata") + The get_sentiments function from tidytext now labels the sentiment score column/variable as value, whereas previously it defaulted to score. Thus, all references made to a score variable in the video tutorial should now be replaced with value. For a conceptual overview of text analysis, please see the following video: https://youtu.be/7JwJr5QrspY. Other videos from my "R Tutorials" playlist can be found here: https://www.youtube.com/playlist?list... The data file(s) referenced in this R tutorial (and other R tutorials on this playlist) can be downloaded as a compressed (zipped) folder by visiting the following link: https://github.com/davidcaughlin/R-Tu.... Click "Clone or Download" followed by "Download ZIP".

Comment