Skip to content

Instantly share code, notes, and snippets.

View DrSkippy's full-sized avatar

Scott Hendrickson DrSkippy

View GitHub Profile
@DrSkippy
DrSkippy / plotTimeSeries.r
Created January 24, 2012 18:31
R script for plotting time series volume data with ggplot, gridextra
#!/usr/bin/env Rscript
#
# Plot time series volume data
# install.packages("ggplot2", dependencies = TRUE )
# install.packages("gridExtra", dependencies = TRUE )
library(ggplot2)
library(gridExtra)
@DrSkippy
DrSkippy / actcounts.txt
Created January 25, 2012 19:05
R script for plotting bandwidth and volume box plots by type and hour with ggplot, gridextra
wp-com, 20120102_0038, 7451
wp-com, 20120102_0138, 6898
wp-com, 20120102_0238, 7398
wp-com, 20120102_0338, 7989
wp-com, 20120102_0438, 9794
wp-com, 20120102_0538, 9066
wp-com, 20120102_0638, 9741
wp-com, 20120102_0738, 10498
wp-com, 20120102_0838, 11650
wp-com, 20120102_0938, 12564
@DrSkippy
DrSkippy / data.csv
Created January 25, 2012 19:11
R script for plotting pulse of social activity with pulse function fit
ts1 ngFit ts2 twFit timestamp date twitter newsgator
1326696009.000000 0.000000 1326696009.000000 0.000000 1326696009 1/16/12 1:40 0 1
1326696069.000000 0.000000 1326696069.000000 0.000000 1326696069 1/16/12 1:41 3 0
1326696129.000000 0.000000 1326696129.000000 0.000000 1326696129 1/16/12 1:42 7 0
1326696189.000000 0.000000 1326696189.000000 0.000000 1326696189 1/16/12 1:43 5 0
1326696249.000000 0.000000 1326696249.000000 0.000000 1326696249 1/16/12 1:44 1 0
1326696309.000000 0.000000 1326696309.000000 0.000000 1326696309 1/16/12 1:45 2 0
1326696369.000000 0.000000 1326696369.000000 0.000000 1326696369 1/16/12 1:46 1 0
1326696429.000000 0.000000 1326696429.000000 0.000000 1326696429 1/16/12 1:47 0 0
1326696489.000000 0.000000 1326696489.000000 0.000000 1326696489 1/16/12 1:48 2 0
@DrSkippy
DrSkippy / CareersAndUnemployment.csv
Created January 25, 2012 21:35
Wall Street Journal Employment Data
Major Field Unemployment Percent 25th % Earnings Median % Earnings 75th % Earnings Popularity
BUSINESS MANAGEMENT AND ADMINISTRATION 0.06 38000 56000 85000 1
GENERAL BUSINESS 0.053 38000 59000 91000 2
ACCOUNTING 0.054 41000 61000 94000 3
NURSING 0.022 48000 60000 80000 4
PSYCHOLOGY 0.061 30000 43000 65000 5
MARKETING AND MARKETING RESEARCH 0.059 40000 59000 90000 6
COMMUNICATIONS 0.063 35000 50000 81000 7
ELEMENTARY EDUCATION 0.036 32000 40000 49000 8
GENERAL EDUCATION 0.042 31000 41000 53000 9
@DrSkippy
DrSkippy / foodNutritionalData.csv
Created January 29, 2012 17:59
Plot a single food in food values context
Food Serving Unit Fat Energy Carbohydrate Protein Cholesterol Weight SaturatedFat
BOKAL CHEESE BALLS 32 balls 7 130 16 2 0 28 2
1000 ISLAND, SALAD DRSNG,LOCAL 1 TBSP 2 25 2 0 2 15 0.2
1000 ISLAND, SALAD DRSNG,REGLR 1 TBSP 6 60 2 0 4 16 1
100% NATURAL CEREAL 1 OZ 6 135 18 3 0 28.35 4.1
40% BRAN FLAKES, KELLOGG'S 1 OZ 1 90 22 4 0 28.35 0.1
40% BRAN FLAKES, POST 1 OZ 0 90 22 3 0 28.35 0.1
ALFALFA SEEDS, SPROUTED, RAW 1 CUP 0 10 1 1 0 33 0
ALL-BRAN CEREAL 1 OZ 1 70 21 4 0 28.35 0.1
ALMONDS, SLIVERED 1 CUP 70 795 28 27 0 135 6.7
@DrSkippy
DrSkippy / hashed_rulestats.csv
Created February 4, 2012 17:34
R script for plotting rules distribution by collector
rules sb rules fraction sbrules collector
9978 4 0.000401 01c0cc19e1bf7911b52af8f79541850e
1 0 0.000000 4859024f7eea91d6ce27f63203b77643
474 0 0.000000 15bb6d3fc83d4f3666a896801139da9e
4365 0 0.000000 376bc0a017d37471e6f94bf928f6bd35
428 0 0.000000 51bb32f3d0756b435a70e40d482cb153
429 0 0.000000 190c513ebde4f5aef665b41e5bb3f160
428 0 0.000000 fcddb86198e7bae1ea221a925696ccaf
428 0 0.000000 102608a09b5e32c2025df41b8efcf836
428 0 0.000000 e29083820db31bd58053a9a5f140ae25
@DrSkippy
DrSkippy / facebookcounts.csv
Created February 8, 2012 16:00
Plot hourly facebook mention volumes for brands/ads/mascots during the superbowl
brand date count
Acura and Seinfeld 2012-02-04 23:31:00 6
Acura and Seinfeld 2012-02-05 00:31:00 6
Acura and Seinfeld 2012-02-05 01:31:00 6
Acura and Seinfeld 2012-02-05 02:31:00 6
Acura and Seinfeld 2012-02-05 03:31:00 6
Acura and Seinfeld 2012-02-05 04:31:00 6
Acura and Seinfeld 2012-02-05 05:31:00 15
Acura and Seinfeld 2012-02-05 06:31:00 6
Acura and Seinfeld 2012-02-05 07:31:00 6
@DrSkippy
DrSkippy / comments_vs_post_age.tab
Created February 10, 2012 20:04
Plot histogram and cumulative distribution function
wppostid postAge Comments
1 476448 32
10 1458735 6
100 673348 2
10009 159250 9
100455 51096 72
100462 61596 7
1005 21925242 3
1006 1102819 16
1007 52413 2
@DrSkippy
DrSkippy / data1.csv
Created February 11, 2012 00:25
Error bars of groups of scores
user in_common_vals dist_score rating
9578 6 87 5.5
9577 10 100 8.25
9576 6 87 8.5
9575 6 87 8
9574 5 71 8
9573 8 99 6.5
9572 8 99 8
9571 8 99 7.5
9570 9 100 6
@DrSkippy
DrSkippy / viewStream.py
Created February 17, 2012 22:30
Python example view of Gnip v2.5 stream output
#!/usr/bin/env python
import urllib2
import base64
import zlib
import threading
from threading import Lock
from cStringIO import StringIO
import json
import sys