Question: Question 3 ( Mandatory ) ( 3 0 points ) Open notes, open WWW , work on your own. You should use R and load

Question 3(Mandatory)(30 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 U.S.A.1492 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
str_split() and unlist() routine you performed in the lab)
(round to nearest 10,000, for example 346,344 would be 350,000)
A
b) Clean the text in this exact order. Remember to use the unlisted object you
created from above to start this process:
remove punctuation/special 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 b 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 100, for example 8,342 would be 8,300)
 Question 3(Mandatory)(30 points) Open notes, open WWW, work on your own.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!