library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ ggplot2 3.4.0 ✔ purrr 0.3.5
## ✔ tibble 3.1.8 ✔ dplyr 1.0.10
## ✔ tidyr 1.2.1 ✔ stringr 1.5.0
## ✔ readr 2.1.3 ✔ forcats 0.5.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
library(tidyr)
library(dplyr)
AP <- read.csv("https://raw.githubusercontent.com/fivethirtyeight/covid-19-polls/master/covid_approval_toplines.csv")
library(scales)
##
## Attaching package: 'scales'
## The following object is masked from 'package:purrr':
##
## discard
## The following object is masked from 'package:readr':
##
## col_factor
colnames(AP)[1] <- "President"
colnames(AP)[2] <- "Model_Date"
colnames(AP)[3] <- "Political_Party"
colnames(AP)[4] <- "Approval_Percentage"
colnames(AP)[5] <- "Disapproval_Percentage"
colnames(AP)[6] <- "Time_Stamp"
AP[AP == "R"] <- "Republican"
AP[AP == "D"] <- "Democrat"
AP[AP == "I"] <- "Independant"
AP[AP == "all"] <- "All"
```