Skip to content

Instantly share code, notes, and snippets.

View trinker's full-sized avatar

Tyler Rinker trinker

  • Kangarootime
  • Buffalo, NY
View GitHub Profile
A Portrait of the Artist as a Young Man by James Joyce Chapter 1 Once upon a time and a very good time it was there was a moocow coming down along the road and this moocow that was coming down along the road met a nicens little boy named baby tuckoo His father told him that story: his father looked at him through a glass: he had a hairy face. <br><br>He was baby tuckoo. <br><br>The moocow came down the road where Betty Byrne lived: she sold lemon platt. <br><br>O, the wild rose blossoms <br><br>On the little green place. <br><br>He sang that song. <br><br>That was his song. <br><br>O, the green wothe botheth. <br><br>When you wet the bed first it is warm then it gets cold. <br><br>His mother put on the oilsheet. <br><br>That had the queer smell. <br><br>His mother had a nicer smell than his father. <br><br>She played on the piano the sailor's hornpipe for him to dance. <br><br>He danced: Tralala lala, Tralala tralaladdy, Tralala lala, Tralala lala. <br><br>Uncle Charles and Dante clapped. <br><br>They were
A Portrait of the Artist as a Young Man by James Joyce Chapter 1 Once upon a time and a very good time it was there was a moocow coming down along the road and this moocow that was coming down along the road met a nicens little boy named baby tuckoo His father told him that story: his father looked at him through a glass: he had a hairy face.<br><br>He was baby tuckoo.<br><br>The moocow came down the road where Betty Byrne lived: she sold lemon platt.<br><br>O, the wild rose blossoms On the little green place.<br><br>He sang that song.<br><br>That was his song.<br><br>O, the green wothe botheth.<br><br>When you wet the bed first it is warm then it gets cold.<br><br>His mother put on the oilsheet.<br><br>That had the queer smell.<br><br>His mother had a nicer smell than his father.<br><br>She played on the piano the sailor's hornpipe for him to dance.<br><br>He danced: Tralala lala, Tralala tralaladdy, Tralala lala, Tralala lala.<br><br>Uncle Charles and Dante clapped.<br><br>They were older than his father
A Portrait of the Artist as a Young Man by James Joyce Chapter 1 Once upon a time and a very good time it was there was a moocow coming down along the road and this moocow that was coming down along the road met a nicens little boy named baby tuckoo His father told him that story: his father looked at him through a glass: he had a hairy face.<br><br>He was baby tuckoo.<br><br>The moocow came down the road where Betty Byrne lived: she sold lemon platt.<br><br>O, the wild rose blossoms On the little green place.<br><br>He sang that song.<br><br>That was his song.<br><br>O, the green wothe botheth.<br><br>When you wet the bed first it is warm then it gets cold.<br><br>His mother put on the oilsheet.<br><br>That had the queer smell.<br><br>His mother had a nicer smell than his father.<br><br>She played on the piano the sailor's hornpipe for him to dance.<br><br>He danced: Tralala lala, Tralala tralaladdy, Tralala lala, Tralala lala.<br><br>Uncle Charles and Dante clapped.<br><br>They were older than his fathe
A Portrait of the Artist as a Young Man by James Joyce Chapter 1 Once upon a time and a very good time it was there was a moocow coming down along the road and this moocow that was coming down along the road met a nicens little boy named baby tuckoo His father told him that story: his father looked at him through a glass: he had a hairy face. He was baby tuckoo. The moocow came down the road where Betty Byrne lived: she sold lemon platt. O, the wild rose blossoms On the little green place. He sang that song. That was his song. O, the green wothe botheth. When you wet the bed first it is warm then it gets cold. His mother put on the oilsheet. That had the queer smell. His mother had a nicer smell than his father. She played on the piano the sailor's hornpipe for him to dance. He danced: Tralala lala, Tralala tralaladdy, Tralala lala, Tralala lala. Uncle Charles and Dante clapped. They were older than his father and mother but uncle Charles was older than Dante. Dante had two brushes in her press. The brush wit
@trinker
trinker / 3-d_like_density_plots
Created April 16, 2017 17:37
3d-like density plots
library(dplyr)
library(tidyr)
library(ggplot2)
library(gridExtra)
df = as.data.frame(setNames(lapply(jitter(sample(-2:2, 8, T)), function(x) rnorm(100, x)), c(LETTERS[1:8]))) %>%
gather("var", "value", A:H)
ggplot(df, aes(x=value)) +
geom_density(fill="black", col="white", lwd=1) +
@trinker
trinker / formattable_example
Last active May 14, 2017 22:44
formattable_example
p_load(formattable)
DF <- data.frame(Ticker=c("", "", "", "IBM", "AAPL", "MSFT"),
Name=c("Dow Jones", "S&P 500", "Technology",
"IBM", "Apple", "Microsoft"),
Value=accounting(c(15988.08, 1880.33, NA,
130.00, 97.05, 50.99)),
Change=percent(c(-0.0239, -0.0216, 0.021,
-0.0219, -0.0248, -0.0399)))
DF
## Ticker Name Value Change
@trinker
trinker / dumbellplot
Created April 16, 2017 17:27
Dumbell plot
dat <- data.frame(
freq = c(37, 88, 47, 89, 28, 68, 65, 98, 68, 86, 50, 87, 59, 82, 45, 65, 52, 32, 59, 47, 68, 78, 39, 31, 64, 68)
)
dat[["sector"]] <- rep(c("U.S. adults", "AAAS scientist"), nrow(dat)/2)
field <- c("Biomedical sciences", "Climate, energy, space sciences")
dat[["field"]] <- factor(rep(field, c(10, 16)), levels=field)
items <- c(
@trinker
trinker / Bar In Bar
Created March 24, 2017 21:09
Bar in Bar
if (!require("pacman")) install.packages("pacman"); library(pacman)
p_load(tidyverse, cowplot)
cols <- c(lightblue = '#62B1F6', darkblue = '#27408B')
dat <- data_frame(
type = state.name[1:18],
Total = c(522, 464, 332, 185, 90, 811, 121, 242, 258, 175, 346, 217, 186, 133, 144, 136, 53, 306),
Sub = c(6, 6, 13, 19, 21, 11, 7, 8, 16, 29, 78, 71, 90, 68, 90, 99, 35, 14)
)
@trinker
trinker / Extract functions from file
Created March 20, 2017 17:51
Extract functions from file
tmp <- getParseData(parse("FILE_NAME_HERE.R", keep.source=TRUE))
dplyr::filter(tmp, token=="SYMBOL_FUNCTION_CALL")
@trinker
trinker / Map Sparkline
Created March 5, 2017 22:50
Map sparkline
p_load(ggplot2, fivethirtyeight, dplyr, gridExtra)
data("police_deaths")
police_deaths_count <- police_deaths %>% arrange(state, -year) %>% group_by(state, year) %>% count()
police_deaths_count <- police_deaths_count %>% arrange(state, -year) %>%
filter(year %in% c(1970:2015) & !state %in% c("AK", "HI", "US", "GU", "MP", "PR", "RR", "TR", "VI"))
# Create unique blank strip labels for empty facets
bl = sapply(1:37, function(n) paste(rep(" ",n),collapse=""))