Skip to content

Instantly share code, notes, and snippets.

🏀

Ryan Rosenberg ryanrosenberg

🏀
Block or report user

Report or block ryanrosenberg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View interactive_map_tutorial.Rmd
---
title: "Making Interactive Maps of Public Data in R"
author: "Ryan Rosenberg"
output: html_document
---
<style>
.leaflet {
margin: auto;
}
</style>
View chicago_pothole_map.R
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))
View bpa_calcs.R
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
@ryanrosenberg
ryanrosenberg / tribune_trivia_map.R
Created Aug 22, 2018
code for making a map from the Tribune's trivia guide
View tribune_trivia_map.R
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()
@ryanrosenberg
ryanrosenberg / riddler_express_date_vandals.R
Created Apr 8, 2018
Solution for Riddler Express 4/8/18
View riddler_express_date_vandals.R
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),
View goss_importer.R
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="##")
View player_comp_plot.R
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 %>%
You can’t perform that action at this time.