Last active
November 24, 2016 03:46
-
-
Save tcash21/ddf62980414d9eea3b6515f466eab002 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(benford.analysis) | |
## read in data | |
counties <- read.csv(file="https://raw.githubusercontent.com/Prooffreader/election_2016_data/master/data/presidential_general_election_2016_by_county.csvhttps://raw.githubusercontent.com/Prooffreader/election_2016_data/master/data/presidential_general_election_2016_by_county.csv") | |
## Run Benford tests | |
hrc <- benford(subset(counties, name == 'H. Clinton')$votes) | |
trump <- benford(subset(counties, name == 'D. Trump')$votes) | |
## plot results | |
plot(hrc) | |
plot(trump) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment