Question: Question 3 ( Mandatory ) ( 3 0 points ) Open notes, open WWW , work on your own. You should use R and load
Question Mandatory points
Open notes, open WWW work on your own. You should use R and load the
following packages: tm stringr, and wordcloud.
Place final answers in provided cells adjacent to questions.
Use R to mine the book Peoples' History of the USA to Present by Howard
Zinn.
The text is stored in the file UShistory.txt Answer the questions below.
a How many words are in the book before cleaning up the text? hint: use the
strsplit and unlist routine you performed in the lab
round to nearest for example would be
A
b Clean the text in this exact order. Remember to use the unlisted object you
created from above to start this process:
remove punctuationspecial characters
remove digits
make everything lowercase
remove stopwords using the 'english' stopwords in package tm
remove extra whitespace
Now, what is the most frequent term used in this book?
A
c Using your cleaned text document from question along with the Positive and
Negative word lexicons provided on blackboard or already saved in your Google
Colab compute the sentiment score for this book. That is what is the result of the
sum function for negative matching subtracted from the sum function for positive
matching? round to nearest for example would be
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
