Plots a heat map of words from Presidential Debate Texts
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Democratic Candidates Debate in Charleston South Carolina January 17 2016.txt
Democratic Candidates Debate in Des Monies Iowa November 14 2015 .txt
Democratic Candidates Debate in Las Vegas Nevada October 13 2015 .txt
Democratic Candidates Debate in Manchester New Hampshire December 19 2015.txt
Republican Candidates Debate in Boulder Colorado October 28 2015.txt
Republican Candidates Debate in Las Vegas Nevada December 15 2015.txt
Republican Candidates Debate in Milwaukee Wisconsin November 10 2015.txt
Republican Candidates Debate in North Charleston South Carolina January 14 2016.txt


Heat Map of Candidate Word Frequencies

Computes a heat map of candidate debate speech from the late 2015 adn early 2106 Republican and Democratic debates. The program allows to filter for spcific topics.

Input .txt files of the debates are also included. Data are acquired from the UCSB Presidency Project. Text were clipped from a web browswer, pasted into Apple Pages on a MacbookAir, and then exported as .txt files. All subsequent processing is done in R.

A sample output of the program is shown here

The program can be tuned by editing the line in the code

    word.filter <- "terror"

which selects debate responses containing that word (selected with a simple regex).


File Name descritpion
[Party] Candidates Debate [Location] [Date].txt text of [Party] debate held in [Location] on [Date]
                                              |                                  |

candidate_text.R |raw text of candidate speech
candidate_text_tc.R |returns a text corpus using the {tm} package
load_debate_text.R |load raw .txt files
multiplot.R |Multiple plot function from here
vector.normalize.R |Makes a vector unit length
| Candidate_HeatMapR_1.Rmd |Produces a heat map graph of candidate text