# Red or Blue? Who do Americans want in office more: Republicans or Democrats?
## I imported the data from fivethirtyeight website , I right clicked on it to view databases & viewed file in RStudio. I removed columns 3 - 6.
library(readr)
library(ggplot2)
generic_ballot_averages <- read_csv("~/Documents/Educational Documents/CUNY SPS SPRING 2024/Data 607/generic_ballot_averages.csv")
## Rows: 3986 Columns: 7
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (1): candidate
## dbl  (4): pct_estimate, lo, hi, cycle
## date (2): date, election
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
data <- generic_ballot_averages [, 3:6]
ggplot(data=data, aes(x = election)) + geom_bar()
## Warning: Removed 506 rows containing non-finite values (`stat_count()`).

## this graph shows the amount of voters over the election year who opted for republicans in office.