Skip to content

Instantly share code, notes, and snippets.

View ryanburge's full-sized avatar

Ryan Burge ryanburge

View GitHub Profile
@ryanburge
ryanburge / 032292017.txt
Last active April 17, 2017 20:27
Class Instructions for 3/29/2017 - Regression
## 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)
}
@ryanburge
ryanburge / April 19th, 2017
Last active April 20, 2017 19:03
Text Analysis
## LOAD THESE PACKAGES FIRST
library(tidytext)
library(dplyr)
library(wordcloud2)
library(ggplot2)
library(readr)
## Follow the directions
@ryanburge
ryanburge / Final_Assignment.txt
Last active April 24, 2017 20:42
A Final Assignment Dealing with Text and Sentiment Analysis
---
title: "Final Assignment"
author: "YOUR NAME"
date: "May 3, 2017"
output: html_document
---
```{r message=FALSE, warning=FALSE}
library(tidytext)
@ryanburge
ryanburge / month.txt
Last active July 18, 2017 18:22
Raphael Stuff.
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)
@ryanburge
ryanburge / Owura_82817
Last active August 28, 2017 18:02
Owura is Learning R Part 1
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.
@ryanburge
ryanburge / Owura_9_6_17
Last active September 6, 2017 17:10
September 6 - Owura
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)
@ryanburge
ryanburge / daca.R
Created September 12, 2017 20:58
DACA Analysis
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
@ryanburge
ryanburge / cces_small.txt
Last active September 16, 2017 13:50
R Workshop 9/16/2017
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
@ryanburge
ryanburge / hchart
Last active September 22, 2017 22:48
high chart basic syntax
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"))
@ryanburge
ryanburge / profitdata.txt
Last active October 4, 2017 16:38
owura_walkthrough
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)