This file contains hidden or 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) | |
buzzes <- read_csv("~/Desktop/regs analysis/all_buzzes.csv") | |
tossups_heard <- read_csv("~/Desktop/regs analysis/tossups_heard.csv") %>% | |
filter(!is.na(Packet)) %>% | |
group_by(Packet) %>% | |
summarize(Heard = max(Heard)) | |
tossups <- buzzes %>% |
This file contains hidden or 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) | |
#### clear workspace #### | |
rm(list=ls()) | |
#### read in the html file and clean up the data #### | |
msgs <- readLines("~/Documents/gosschat.html") | |
msgs <- gsub(" ", msgs, replacement="__") | |
msgs <- gsub("\"", msgs, replacement="##") | |
msgs <- gsub("\'", msgs, replacement="##") |
This file contains hidden or 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) | |
month_vec <- c(rep(1, 31), | |
rep(2, 28), | |
rep(3, 31), | |
rep(4, 30), | |
rep(5, 31), | |
rep(6, 30), | |
rep(7, 31), | |
rep(8, 31), |
This file contains hidden or 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(rvest) | |
library(leaflet) | |
library(mapsapi) | |
trivia <- "http://www.chicagotribune.com/redeye/culture/ct-redeye-do-trivia-chicago-bars-20180320-story.html" | |
bars <- read_html(trivia) %>% | |
html_nodes("a strong") %>% | |
html_text() |
This file contains hidden or 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) | |
regs_tossups <- read_tsv("tossups.tsv") | |
regs_games_played <- regs_tossups %>% | |
filter(!is.na(team), packet != "S", !is.na(buzz_location_pct)) %>% | |
distinct(team, packet) %>% | |
count(team) | |
# Change based on set categories |
This file contains hidden or 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(sf) | |
library(lubridate) | |
chicago_neighborhoods <- read_sf("chi_community_shapefiles") %>% | |
mutate(community_area = as.integer(area_numbe)) | |
chicago_potholes <- read_csv("chicago_potholes.csv") %>% | |
janitor::clean_names() %>% | |
mutate_at(vars(creation_date, completion_date), mdy) %>% | |
mutate(time_to_fill = difftime(completion_date, creation_date)) |
This file contains hidden or 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: "Making Interactive Maps of Public Data in R" | |
author: "Ryan Rosenberg" | |
output: html_document | |
--- | |
<style> | |
.leaflet { | |
margin: auto; | |
} | |
</style> |