Skip to content

Instantly share code, notes, and snippets.

@hafen
hafen / README.md
Created October 7, 2015 07:31
NYC Taxi Manhattan Pickups vs. Time
figure(width = 1100, height = 450) %>%
  ly_lines(hourly) %>%
  ly_points(hourly, hover = hourly, alpha = 0) %>%
  y_axis(log = 2) %>%
  tool_pan(dimensions = "width") %>%
  tool_wheel_zoom(dimensions = "width")
@hafen
hafen / README.md
Created October 7, 2015 07:52
NYC Taxi Manhattan Fare vs. Distance by Rate Level
grid_plot(panels, ncol = 4, same_axes = TRUE)
@hafen
hafen / README.md
Created October 7, 2015 07:57
NYC Taxi Manhattan Pickups vs. Time
figure(width = 1000, height = 450) %>%
  ly_lines(hourly) %>%
  ly_points(hourly, hover = hourly, alpha = 0) %>%
  y_axis(log = 2) %>%
  tool_pan(dimensions = "width") %>%
  tool_wheel_zoom(dimensions = "width")
@hafen
hafen / README.md
Created October 8, 2015 18:59
rbokeh gmap test
# devtools::install_github("bokeh/rbokeh@dev")
library(rbokeh)
library(maps)

m <- map("state", region = "colorado", plot = FALSE)
mx <- mean(range(m$x, na.rm = TRUE))
my &lt;- mean(range(m$y, na.rm = TRUE))
@hafen
hafen / README.md
Last active November 13, 2015 17:27
rbokeh gmap test
# devtools::install_github("bokeh/rbokeh@dev")
library(rbokeh)
library(maps)

m <- map("state", region = "colorado", plot = FALSE)
mx <- mean(range(m$x, na.rm = TRUE))
my &lt;- mean(range(m$y, na.rm = TRUE))
@hafen
hafen / 201512_nycbike_summ.csv
Created January 27, 2016 23:46
NYC Citi Bike Summary by Station December 2015
station lat lon n_start n_end
1 Ave & E 15 St 40.73221853 -73.98165557 4258 4272
1 Ave & E 18 St 40.7338121919663 -73.9805442094803 2854 2860
1 Ave & E 30 St 40.74144387 -73.97536082 3241 3251
1 Ave & E 44 St 40.75001986 -73.96905301 2020 2013
1 Ave & E 62 St 40.7612274 -73.96094022 2165 2156
1 Ave & E 68 St 40.76500525 -73.95818491 3533 3530
1 Ave & E 78 St 40.77140426 -73.9535166 2321 2377
10 Ave & W 28 St 40.75066386 -74.00176802 3000 3015
11 Ave & W 27 St 40.751396 -74.005226 2773 2786
@hafen
hafen / communitydistricts.csv
Last active February 2, 2016 01:13
Some NYC community district boundaries (csv)
x y which
-73.9582921680775 40.6798311339974 4
-73.9559586243738 40.6793462471508 4
-73.9552936159939 40.6792031510439 4
-73.9541276615553 40.6789579768563 4
-73.9529867271405 40.6787219954922 4
-73.9520634525867 40.6785863307184 4
-73.9496756738759 40.6784566821854 4
-73.9486972516062 40.6784171310242 4
-73.9486177802656 40.678414178402 4
@hafen
hafen / README.md
Created February 4, 2016 07:22
NYC
gmap(lat = 40.73306, lng = -73.97351, zoom = 12,
  width = 600, height = 600)
@hafen
hafen / README.md
Created February 4, 2016 07:23
NYC
gmap(lat = 40.73306, lng = -73.97351, zoom = 12,
  width = 680, height = 600)
@hafen
hafen / README.md
Created February 4, 2016 07:26
NYC bikes 1
gmap(lat = 40.73306, lng = -73.97351, zoom = 12,
  width = 680, height = 600, map_type = "hybrid") %>%
  ly_points(lon, lat, data = bike, hover = c(station, n_start, n_end))