Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started