Skip to content

Instantly share code, notes, and snippets.

@stedy
Last active Aug 29, 2015
Embed
What would you like to do?
date name
2014-01-01
2014-01-02
2014-01-03 Snorting Elk
2014-01-04 Bull Wheel
2014-01-05
2014-01-06
2014-01-07
2014-01-08 Caroline Tavern
2014-01-09 Redwood
2014-01-10 Harbor Public House
2014-01-10 Bainbridge Island Brewery
2014-01-11
2014-01-12 Joey
2014-01-13 Nickerson St. Saloon
2014-01-14
2014-01-15
2014-01-16
2014-01-17 Chandler's
2014-01-18
2014-01-19 Talarico's
2014-01-20
2014-01-21
2014-01-22
2014-01-23 Island Hoppin Brewery
2014-01-24
2014-01-25
2014-01-26
2014-01-27
2014-01-28
2014-01-29
2014-01-30 Vermillion
2014-01-31 Tempero do Brasil
2014-02-01
2014-02-02
2014-02-03
2014-02-04 Mulleady's
2014-02-05 Nickerson St. Saloon
2014-02-06
2014-02-07
2014-02-08 Brave Horse Tavern
2014-02-08 Columbia Tower Club
2014-02-09
2014-02-10
2014-02-11
2014-02-12 Timberwolf Bar
2014-02-13
2014-02-14
2014-02-15 Mulleady's
2014-02-15 Six Gill
2014-02-15 Red Door
2014-02-16
2014-02-17 Milano's
2014-02-18
2014-02-19
2014-02-20
2014-02-21
2014-02-22 Magnolia Village Pub
2014-02-23
2014-02-24
2014-02-25
2014-02-26
2014-02-27
2014-02-28 Mariscos Nayarit
2014-03-01
2014-03-02 Ponte Winery
2014-03-03 Blue Ribbon Country Cafe
2014-03-04 Fish 101
2014-03-04 Regal Eagle
2014-03-05
2014-03-06 WAC
2014-03-07
2014-03-08 Mulleady's
2014-03-09
2014-03-10 Mulleady's
2014-03-11
2014-03-12
2014-03-13
2014-03-14 Mulleady's
2014-03-15
2014-03-16
2014-03-17 Little Water Cantina
2014-03-18
2014-03-19
2014-03-20 Targy's
2014-03-21
2014-03-22
2014-03-23
2014-03-24
2014-03-25
2014-03-26
2014-03-27 Mulleady's
2014-03-28 Tempero do Brasil
2014-03-29 Cask & Schooner
2014-03-30
2014-03-31 Pies & Pints
2014-04-01
2014-04-02
2014-04-03
2014-04-04
2014-04-05
2014-04-06
2014-04-07
2014-04-08
2014-04-09
2014-04-10 A Terrible Beauty
2014-04-11 Hilliard's
2014-04-12
2014-04-13 Barrel Thief
2014-04-13 Six Gill
2014-04-14
2014-04-15 Zoo
2014-04-16
2014-04-17
2014-04-18
2014-04-19
2014-04-20
2014-04-21
2014-04-22 West 5
2014-04-23
2014-04-24 Pike Brewery
2014-04-25 Auto Battery
2014-04-25 Cafe Presse
2014-04-26
2014-04-27
2014-04-28 Big Time
2014-04-29
2014-04-30 Six Gill
2014-05-01
2014-05-02
2014-05-03 Khyber Pass
2014-05-03 Citizen's Bank Park
2014-05-04 Burning Bridge Tavern
2014-05-05
2014-05-06 PNC Park
2014-05-07 Staple & Fancy
2014-05-08
2014-05-09 Pyramid Brewing
2014-05-09 Fuel
2014-05-10 Loretta's
2014-05-11
2014-05-12
2014-05-13
2014-05-14
2014-05-15 Chandler's
2014-05-16
2014-05-17
2014-05-18 Sirens
2014-05-19 A Terrible Beauty
2014-05-20 Tug Inn
2014-05-21
2014-05-22
2014-05-23
2014-05-24
2014-05-25 Boundary Bay
2014-05-26
2014-05-27
2014-05-28
2014-05-29 Nickerson St. Saloon
2014-05-30
2014-05-31 Hofbrau Haus
2014-06-01
2014-06-02
2014-06-03
2014-06-04
2014-06-05
2014-06-06 Reuben's
2014-06-07
2014-06-08
2014-06-09
2014-06-10
2014-06-11 The Outlander
2014-06-12
2014-06-13
2014-06-14
2014-06-15
2014-06-16 LTD
2014-06-17
2014-06-18
2014-06-19
2014-06-20
2014-06-21 World of Beers
2014-06-21 Linda's
2014-06-21 Poquitos
2014-06-22
2014-06-23
2014-06-24 Chandler's
2014-06-25
2014-06-26
2014-06-27 Trailhead Tavern
2014-06-28
2014-06-29
2014-06-30
2014-07-01
2014-07-02
2014-07-03 A Terrible Beauty
2014-07-04
2014-07-05
2014-07-06
2014-07-07
2014-07-08
2014-07-09
2014-07-10 Oskar's Kitchen
2014-07-10 Peso's
2014-07-11 Barking Dog
2014-07-12
2014-07-13
2014-07-14
2014-07-15
2014-07-16
2014-07-17
2014-07-18 Mo's
2014-07-19 Mist
2014-07-20
2014-07-21
2014-07-22 Nickerson St. Saloon
2014-07-23 Fremont Brewery
2014-07-24
2014-07-25 Six Gill
2014-07-26
2014-07-27
2014-07-28
2014-07-29
2014-07-30
2014-07-31
2014-08-01
2014-08-02 Sand Pt. CC
2014-08-03
2014-08-04
2014-08-05
2014-08-06 Barking Dog
2014-08-07 Big Time
2014-08-08
2014-08-09
2014-08-10 Colmbia City Alehouse
2014-08-11 Siam Thai
2014-08-12
2014-08-13
2014-08-14 Essex
2014-08-14 Delancy's
2014-08-15
2014-08-16 Waterwheel
2014-08-17
2014-08-18
2014-08-19
2014-08-20
2014-08-21
2014-08-22
2014-08-23
2014-08-24
2014-08-25
2014-08-26
2014-08-27
2014-08-28 Chandler's
2014-08-29
2014-08-30
2014-08-31
2014-09-01 The Yard
2014-09-02
2014-09-03
2014-09-04
2014-09-05 El Quetzal
2014-09-05 Tippe and Drague
2014-09-06 Remlinger Farms
2014-09-07 BeachHouse
2014-09-08
2014-09-09 Vito's
2014-09-10
2014-09-11
2014-09-12
2014-09-13
2014-09-14
2014-09-15
2014-09-16
2014-09-17 Barking Dog
2014-09-18
2014-09-19
2014-09-20 The Villa
2014-09-21
2014-09-22
2014-09-23
2014-09-24
2014-09-25 Box House
2014-09-26
2014-09-27
2014-09-28
2014-09-29
2014-09-30
2014-10-01
2014-10-02
2014-10-03
2014-10-04
2014-10-05
2014-10-06
2014-10-07 Nickerson St. Saloon
2014-10-08
2014-10-09
2014-10-10
2014-10-11 Twisp River Pub
2014-10-12
2014-10-13
2014-10-14 Grim's
2014-10-15
2014-10-16
2014-10-17 Fremont Brewing
2014-10-17 Red Door
2014-10-18
2014-10-19
2014-10-20
2014-10-21
2014-10-22
2014-10-23 Mile High Stadium
2014-10-24 Pourhouse
2014-10-25 Hughes Stadium
2014-10-26
2014-10-27
2014-10-28
2014-10-29 Feirabend
2014-10-30 White Horse Trading Co.
2014-10-31
2014-11-01 Big Time
2014-11-02 Elysim Brewing
2014-11-03
2014-11-04
2014-11-05 Barking Dog
2014-11-06 The Yard
2014-11-07 Pintxo
2014-11-08
2014-11-09
2014-11-10
2014-11-11 Prost W. Seattle
2014-11-12
2014-11-13
2014-11-14 Fremont Dock
2014-11-15
2014-11-16
2014-11-17
2014-11-18
2014-11-19
2014-11-20
2014-11-21 Six Gill
2014-11-22
2014-11-23 Pourhouse
2014-11-24
2014-11-25 Columbia City Alehouse
2014-11-26 Brave Horse
2014-11-27
2014-11-28
2014-11-29
2014-11-30
2014-12-01
2014-12-02 Matador
2014-12-03
2014-12-04 Essex
2014-12-05
2014-12-06
2014-12-07
2014-12-08
2014-12-09 Big Time
2014-12-10
2014-12-11
2014-12-12 Pine Box
2014-12-13 Pecado Bueno
2014-12-14
2014-12-15
2014-12-16 Pies & Pints
2014-12-16 Chuck's
2014-12-17
2014-12-18 Six Gill
2014-12-19 Six Gill
2014-12-19 Skansonia
2014-12-20
2014-12-21
2014-12-22
2014-12-23
2014-12-24
2014-12-25
2014-12-26
2014-12-27
2014-12-28
2014-12-29
2014-12-30
2014-12-31
library(ggplot2)
library(plyr)
library(tidyr)
library(lubridate)
beer <- read.csv("bars_2014.csv", na.strings="")
run <- read.csv("run_2014.csv")
beerm <- ddply(beer, "date", function(x) data.frame(count=length(unique(na.omit(x$name)))))
final <- merge(beerm, run)
final[is.na(final)] <- 0
final$cal.in <- final$count * 2 * 180
final$cal.out <- final$distance * 145
final$residual <- final$cal.out - final$cal.in
forplot <- final[c('date', 'cal.in', 'cal.out', 'residual')]
forplot$week <- week(forplot$date)
forplot$date <- NULL
forplot.m <- gather(forplot, type, amount, -week)
qplot(week, amount,data=forplot.m, color=type) + geom_smooth() + ggtitle("Beers consumed at bars vs. running in 2014")
date distance
2014-01-01 4
2014-01-02
2014-01-03
2014-01-04
2014-01-05
2014-01-06 3
2014-01-07 3
2014-01-08
2014-01-09
2014-01-10 4.5
2014-01-11
2014-01-12 6.5
2014-01-13 3
2014-01-14
2014-01-15 4
2014-01-16
2014-01-17 6
2014-01-18
2014-01-19 7
2014-01-20 4.5
2014-01-21
2014-01-22 4
2014-01-23
2014-01-24
2014-01-25 15
2014-01-26
2014-01-27
2014-01-28
2014-01-29
2014-01-30
2014-01-31
2014-02-01
2014-02-02
2014-02-03
2014-02-04
2014-02-05 1
2014-02-06
2014-02-07 3
2014-02-08
2014-02-09
2014-02-10 3
2014-02-11
2014-02-12 3
2014-02-13
2014-02-14 4.5
2014-02-15
2014-02-16
2014-02-17
2014-02-18
2014-02-19 4
2014-02-20
2014-02-21 3
2014-02-22 7
2014-02-23
2014-02-24
2014-02-25
2014-02-26
2014-02-27 4.5
2014-02-28 4
2014-03-01
2014-03-02 5
2014-03-03
2014-03-04
2014-03-05
2014-03-06 3
2014-03-07 4
2014-03-08
2014-03-09 4
2014-03-10
2014-03-11 3
2014-03-12 4
2014-03-13 4.5
2014-03-14
2014-03-15 6
2014-03-16 7
2014-03-17 3
2014-03-18
2014-03-19 3
2014-03-20
2014-03-21
2014-03-22
2014-03-23
2014-03-24
2014-03-25
2014-03-26
2014-03-27
2014-03-28
2014-03-29
2014-03-30
2014-03-31
2014-04-01
2014-04-02
2014-04-03
2014-04-04
2014-04-05
2014-04-06
2014-04-07
2014-04-08
2014-04-09
2014-04-10
2014-04-11
2014-04-12
2014-04-13
2014-04-14 3
2014-04-15
2014-04-16
2014-04-17 3
2014-04-18 4
2014-04-19 4
2014-04-20
2014-04-21
2014-04-22
2014-04-23 3
2014-04-24 3
2014-04-25
2014-04-26 3
2014-04-27 5
2014-04-28 3
2014-04-29
2014-04-30 3
2014-05-01
2014-05-02 6
2014-05-03
2014-05-04
2014-05-05
2014-05-06 3
2014-05-07 3
2014-05-08 3
2014-05-09
2014-05-10
2014-05-11 8
2014-05-12
2014-05-13
2014-05-14 3
2014-05-15
2014-05-16
2014-05-17 5
2014-05-18 7
2014-05-19
2014-05-20
2014-05-21 4
2014-05-22 3
2014-05-23
2014-05-24
2014-05-25 7
2014-05-26
2014-05-27 3
2014-05-28 4
2014-05-29
2014-05-30 4
2014-05-31
2014-06-01
2014-06-02 3.5
2014-06-03
2014-06-04 3
2014-06-05
2014-06-06 4
2014-06-07
2014-06-08
2014-06-09 6
2014-06-10
2014-06-11 3
2014-06-12
2014-06-13
2014-06-14 3
2014-06-15 6
2014-06-16
2014-06-17
2014-06-18
2014-06-19
2014-06-20
2014-06-21
2014-06-22
2014-06-23
2014-06-24
2014-06-25 2.5
2014-06-26
2014-06-27 4
2014-06-28 3.5
2014-06-29
2014-06-30 3
2014-07-01
2014-07-02
2014-07-03 3
2014-07-04
2014-07-05 5
2014-07-06
2014-07-07 3
2014-07-08 4
2014-07-09
2014-07-10
2014-07-11 3
2014-07-12
2014-07-13
2014-07-14
2014-07-15
2014-07-16 3
2014-07-17
2014-07-18
2014-07-19
2014-07-20
2014-07-21 3
2014-07-22
2014-07-23
2014-07-24 3.5
2014-07-25 5
2014-07-26
2014-07-27
2014-07-28 3
2014-07-29
2014-07-30
2014-07-31 5
2014-08-01 3
2014-08-02
2014-08-03 5
2014-08-04
2014-08-05
2014-08-06 5
2014-08-07 3
2014-08-08
2014-08-09
2014-08-10
2014-08-11
2014-08-12
2014-08-13 3
2014-08-14 5
2014-08-15
2014-08-16 5
2014-08-17
2014-08-18 3
2014-08-19 4
2014-08-20
2014-08-21
2014-08-22
2014-08-23
2014-08-24
2014-08-25
2014-08-26
2014-08-27 3
2014-08-28 3
2014-08-29
2014-08-30 3
2014-08-31
2014-09-01
2014-09-02 4
2014-09-03 3
2014-09-04
2014-09-05 4.5
2014-09-06
2014-09-07 5
2014-09-08 4
2014-09-09
2014-09-10 3
2014-09-11 3
2014-09-12
2014-09-13
2014-09-14
2014-09-15 3
2014-09-16
2014-09-17 3.5
2014-09-18 4
2014-09-19
2014-09-20
2014-09-21 5
2014-09-22 3
2014-09-23
2014-09-24 3
2014-09-25
2014-09-26 4
2014-09-27
2014-09-28
2014-09-29 4
2014-09-30 5
2014-10-01 3
2014-10-02
2014-10-03
2014-10-04
2014-10-05
2014-10-06 3
2014-10-07
2014-10-08 3
2014-10-09
2014-10-10 5
2014-10-11
2014-10-12
2014-10-13
2014-10-14
2014-10-15
2014-10-16 3
2014-10-17
2014-10-18 7
2014-10-19
2014-10-20 3
2014-10-21 4
2014-10-22
2014-10-23
2014-10-24
2014-10-25 4
2014-10-26
2014-10-27 3
2014-10-28
2014-10-29
2014-10-30 3
2014-10-31
2014-11-01 5
2014-11-02 4
2014-11-03
2014-11-04 3
2014-11-05 5.5
2014-11-06
2014-11-07 3
2014-11-08
2014-11-09 7
2014-11-10
2014-11-11 4
2014-11-12 5.5
2014-11-13
2014-11-14
2014-11-15 4
2014-11-16 3
2014-11-17 4
2014-11-18
2014-11-19 4
2014-11-20
2014-11-21
2014-11-22 4.5
2014-11-23
2014-11-24 4.5
2014-11-25
2014-11-26
2014-11-27
2014-11-28
2014-11-29 6
2014-11-30 7
2014-12-01
2014-12-02
2014-12-03 3
2014-12-04
2014-12-05
2014-12-06 10
2014-12-07 5.5
2014-12-08
2014-12-09 4.5
2014-12-10
2014-12-11 3
2014-12-12 4
2014-12-13 9
2014-12-14
2014-12-15 3
2014-12-16
2014-12-17 3.5
2014-12-18
2014-12-19 3.5
2014-12-20
2014-12-21 9
2014-12-22
2014-12-23
2014-12-24
2014-12-25
2014-12-26 4
2014-12-27
2014-12-28
2014-12-29 5
2014-12-30
2014-12-31 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment