5.1 Loading packages

### Use the code below to check if you have all required packages installed. If some are not installed already, the code below will install these. If you have all packages installed, then you could load them with the second code.
requiredPackages = c('tidyverse', 'tidytext', 'rvest', 'janeaustenr', 'proustr', 'textdata', 'gutenbergr', 'quanteda', 'readtext')
for(p in requiredPackages){
  if(!require(p,character.only = TRUE)) install.packages(p)
  library(p,character.only = TRUE)
}
## Loading required package: tidytext
## Loading required package: rvest
## 
## Attaching package: 'rvest'
## The following object is masked from 'package:readr':
## 
##     guess_encoding
## Loading required package: janeaustenr
## Loading required package: proustr
## 
## Attaching package: 'proustr'
## The following object is masked from 'package:tidytext':
## 
##     stop_words
## Loading required package: textdata
## Loading required package: gutenbergr
## Loading required package: quanteda
## Package version: 4.3.1
## Unicode version: 15.1
## ICU version: 74.1
## Parallel computing: 12 of 12 threads used.
## See https://quanteda.io for tutorials and examples.
## Loading required package: readtext
## 
## Attaching package: 'readtext'
## The following object is masked from 'package:quanteda':
## 
##     texts