Skip to content
master
Go to file
Code

README.md

CandidateHeatMap

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

    ##FILTER TEXT
    word.filter <- "terror"

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

###FILES:

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

About

Plots a heat map of words from Presidential Debate Texts

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.