Problems

Hone your R skills by doing problems.

Please attempt all questions.

The assignment is due Friday 17 November and you are encouraged to work in group and to hand in a single copy for the group.

1 Fetch the last 100 posts from your favorite politician.

1.1 Remove any word that you deem unecessary. How do you do that?

1.2 Create a word cloud from the cleaned up list.

1.3 Fetch the last 100 posts from a second politician.

Devise a method to determine which one cares the most about the economy. Hint: create or download a dictionary of economic terms.

  • They are not too concerned.

2 Load the inaugural speech data from quanteda::data_corpus_inaugural.

I suggest you download the positive.txt and negative.txt lists from the course homepage.

2.1 Is the distribution of positive and negative terms constant accross presidents (not speeches)?

Use dfm_weight(, ‘relFreq’) to get comparable numbers. Try to plot the values accross presidents.

2.2 Create your own dictionary with at least two categories.

Create a barplot showing how frequently they appear accross presidents.