The full transcript of the speech can be found in this link https://www.nytimes.com/2021/04/29/us/politics/joe-biden-speech-transcript.html

Using the following packages

Reading the data from a website

An open source software add-in on Google Chrome “selectorgadget” is used for scraping information from the website. The gadget is used to select the parts of the website and get the relevant tags to the website.

https://rvest.tidyverse.org/articles/selectorgadget.html#:~:text=SelectorGadget%20is%20a%20JavaScript%20bookmarklet,desired%20components%20from%20a%20page. provides more detail on this topic.

The following code is used to read the content from the Nytimes.com portal

Preprocessing

take out the stopwords
create a dataframe

Top 20 Words in Biden’s Speech to Congress"

## Selecting by n

## 
##        anger anticipation      disgust         fear          joy     negative 
##         1247          839         1058         1476          689         3324 
##     positive      sadness     surprise        trust 
##         2312         1191          534         1231
##              sentiment
## word          anger anticipation disgust fear joy negative positive sadness
##   abacus          0            0       0    0   0        0        0       0
##   abandon         0            0       0    1   0        1        0       1
##   abandoned       1            0       0    1   0        1        0       1
##   abandonment     1            0       0    1   0        1        0       1
##   abba            0            0       0    0   0        0        1       0
##   abbot           0            0       0    0   0        0        0       0
##              sentiment
## word          surprise trust
##   abacus             0     1
##   abandon            0     0
##   abandoned          0     0
##   abandonment        1     0
##   abba               0     0
##   abbot              0     1
## 
## negative positive 
##     4781     2005
## 
##  -5  -4  -3  -2  -1   0   1   2   3   4   5 
##  16  43 264 966 309   1 208 448 172  45   5
## 
## constraining    litigious     negative     positive  superfluous  uncertainty 
##          184          904         2355          354           56          297

visualize sentiments by words sentiment

## Joining, by = "word"

Top Words Contribute to Sentiments in Biden’s Speech to Congress

## Joining, by = "word"
## Selecting by n

All emotion

## Joining, by = "word"

```

Thanks to…

Dr. Armando E. Rodriguez (https://www.newhaven.edu/faculty-staff-profiles/armando-rodriguez.php)

Dr. Ahmet Ozkul (https://www.newhaven.edu/faculty-staff-profiles/ahmet-ozkul.php)

Department of Economics and Business Analytics (https://www.newhaven.edu/business/graduate-programs/business-analytics/index.php)