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
## RUN ALL THIS SYNTAX BEFORE WE START | |
## This will install and load all the packages you need for class today. | |
ipak <- function(pkg){ | |
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
if (length(new.pkg)) | |
install.packages(new.pkg, dependencies = TRUE) | |
sapply(pkg, require, character.only = TRUE) | |
} |
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
## LOAD THESE PACKAGES FIRST | |
library(tidytext) | |
library(dplyr) | |
library(wordcloud2) | |
library(ggplot2) | |
library(readr) | |
## Follow the directions |
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
--- | |
title: "Final Assignment" | |
author: "YOUR NAME" | |
date: "May 3, 2017" | |
output: html_document | |
--- | |
```{r message=FALSE, warning=FALSE} | |
library(tidytext) |
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
appname <- "rtweet_token" | |
key <- "decr5ihOVeN71tR1ZjtPXiswe" | |
secret <- "vM1GGNkLmXOwIKVMqO7T5B5s8xfwJmcLmu3Htbx4GI4590krbd" | |
twitter_token <- create_token( | |
app = appname, | |
consumer_key = key, | |
consumer_secret = secret) | |
trump <- get_timeline("realdonaldtrump", n = 3200) |
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
Here's the data link: | |
simon <- read.csv(url("http://goo.gl/exQA14")) | |
Here's the link to the codebook: | |
http://opensiuc.lib.siu.edu/cgi/viewcontent.cgi?article=1010&context=ppi_statepolls | |
library(tidyverse) | |
library(janitor) | |
Here are 3 tasks for you. Send me a file back that has the syntax that you used to addresses the following tasks. |
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
Here's the data link: | |
simon <- read.csv(url("http://goo.gl/exQA14")) | |
Here's the link to the codebook: | |
http://opensiuc.lib.siu.edu/cgi/viewcontent.cgi?article=1010&context=ppi_statepolls | |
library(tidyverse) | |
library(janitor) | |
library(car) |
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(wordcloud) | |
library(wordcloud2) | |
library(tidytext) | |
library(janitor) | |
library(tidyverse) | |
library(extrafont) | |
daca <- read_csv("C:/Users/Ryan Burge/Desktop/daca.csv") %>% clean_names() | |
## Simple Word Cloud |
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(tidyverse) | |
library(janitor) | |
library(car) | |
## Load the data using this line: | |
cces <- read_csv("https://raw.githubusercontent.com/ryanburge/cces/master/small_cces.csv") | |
## Here's a link to download the codebook | |
https://github.com/ryanburge/cces/raw/master/Codebooks/CCES_2016_Small_Codebook.pdf |
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
grad %>% arrange(grad_enroll) %>% hchart("line", hcaes(x = fct_rev(year), y=grad_enroll)) %>% hc_legend(enabled = TRUE) %>% hc_add_theme(hc_theme_gridlight()) %>% | |
hc_xAxis(title = list(text = "Year")) %>% | |
hc_yAxis(title = list(text = "Total Graduate Enrollment")) %>% | |
hc_tooltip(valueDecimals = 0, | |
pointFormat = "Total: {point.y}") %>% | |
hc_title(text = "EIU's PLS Graduate Enrollment", | |
style = list(fontWeight = "bold")) |
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
first <- profit %>% | |
filter(Year == "2011-2012") %>% | |
mutate(total.tuition = Fall + Spring + Summer) %>% | |
mutate(net = total.tuition - (Waivers + Scholarships)) | |
last <- profit %>% | |
filter(Year == "2015-2016") %>% | |
mutate(total.tuition = Fall + Spring + Summer) %>% | |
mutate(net = total.tuition - (Waivers + Scholarships)) %>% | |
select(Year, Dept, Personnel, net) |