Chapter 7 Homework 3 Project

library(caret)
## Loading required package: lattice
## Loading required package: ggplot2
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ tibble  3.0.6     ✓ dplyr   1.0.4
## ✓ tidyr   1.1.2     ✓ stringr 1.4.0
## ✓ readr   1.4.0     ✓ forcats 0.5.1
## ✓ purrr   0.3.4
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
## x purrr::lift()   masks caret::lift()
#clean code
tweets <- as_tibble(tweets_raw)

tweets_raw
## # A tibble: 16,005 x 843
##    `#abddarb` `#adsb` `#america` `#americafirst` `#american` `#antifa`
##    <chr>        <dbl>      <dbl>           <dbl>       <dbl>     <dbl>
##  1 0.0              0          0               0           0         0
##  2 0.0              0          0               0           0         0
##  3 0.0              0          0               0           0         0
##  4 0.0              0          0               0           0         0
##  5 0.0              0          0               0           0         0
##  6 0.0              0          0               0           0         0
##  7 0.0              0          0               0           0         0
##  8 0.0              0          0               0           0         0
##  9 0.0              0          0               0           0         0
## 10 0.0              0          0               0           0         0
## # … with 15,995 more rows, and 837 more variables: `#atlanta` <dbl>,
## #   `#aukland` <dbl>, `#australia` <dbl>, `#baltimor` <dbl>, `#biden` <dbl>,
## #   `#bidencheated2020` <dbl>, `#bidencrimefamilli` <dbl>, `#bidenharri` <dbl>,
## #   `#bidenharris2020` <dbl>, `#bidenharrisinaugur` <dbl>,
## #   `#bideninaugur` <dbl>, `#bidenwillneverbepresid` <dbl>,
## #   `#blacklivesmatt` <dbl>, `#blm` <dbl>, `#boston` <dbl>, `#break` <dbl>,
## #   `#breakingnew` <dbl>, `#california` <dbl>, `#canada` <dbl>,
## #   `#capitalhil` <dbl>, `#capitol` <dbl>, `#capitolbuild` <dbl>,
## #   `#capitolhil` <dbl>, `#capitolriot` <dbl>, `#chicago` <dbl>, `#cnn` <dbl>,
## #   `#congress` <dbl>, `#constitut` <dbl>, `#coronaviru` <dbl>,
## #   `#covid19` <dbl>, `#deal` <dbl>, `#democraci` <dbl>, `#democrat` <dbl>,
## #   `#denver` <dbl>, `#dmv` <dbl>, `#domesticterrorist` <dbl>,
## #   `#donaldtrump` <dbl>, `#draintheswamp` <dbl>, `#edinburgh` <dbl>,
## #   `#eeuu` <dbl>, `#election2020` <dbl>, `#electionintegr` <dbl>,
## #   `#fashion` <dbl>, `#fbi` <dbl>, `#fightback` <dbl>, `#fightfortrump` <dbl>,
## #   `#florida` <dbl>, `#freedom` <dbl>, `#georgia` <dbl>, `#gop` <dbl>,
## #   `#govern` <dbl>, `#houston` <dbl>, `#impeach` <dbl>, `#inaugur` <dbl>,
## #   `#inauguration2021` <dbl>, `#inaugurationday` <dbl>,
## #   `#inaugurationday2021` <dbl>, `#insurrect` <dbl>, `#jan6` <dbl>,
## #   `#january6th` <dbl>, `#joebiden` <dbl>, `#kag` <dbl>, `#kamalaharri` <dbl>,
## #   `#london` <dbl>, `#losangel` <dbl>, `#maga` <dbl>, `#maga2020` <dbl>,
## #   `#manchest` <dbl>, `#marchfortrump` <dbl>, `#maryland` <dbl>,
## #   `#miami` <dbl>, `#montreal` <dbl>, `#nationalguard` <dbl>, `#new` <dbl>,
## #   `#newyork` <dbl>, `#nyc` <dbl>, `#outland` <dbl>, `#patriot` <dbl>,
## #   `#philadelphia` <dbl>, `#polit` <dbl>, `#potu` <dbl>, `#presid` <dbl>,
## #   `#presidenttrump` <dbl>, `#protest` <dbl>, `#proudboy` <dbl>,
## #   `#qanon` <dbl>, `#republican` <dbl>, `#rig` <dbl>, `#riggedelect` <dbl>,
## #   `#riot` <dbl>, `#sanfrancisco` <dbl>, `#scotland` <dbl>, `#sedit` <dbl>,
## #   `#senat` <dbl>, `#stopthest` <dbl>, `#stopthesteai` <dbl>,
## #   `#stopthesteai2020` <dbl>, `#stopthesteai2021` <dbl>, `#sydney` <dbl>,
## #   `#texa` <dbl>, …

7.1 HW1

7.1.1 Q1

7.1.2 Q2

7.1.3 Q3

7.1.4 Q4

7.2 R Markdown