Skip to content

Instantly share code, notes, and snippets.

View pboesu's full-sized avatar

Philipp Boersch-Supan pboesu

View GitHub Profile
@pboesu
pboesu / mtcars-cat.R
Last active November 18, 2016 10:47 — forked from dill/mtcars-cat.R
categorical emojis -- like this Mark?
library(emoGG)
library(ggplot2)
#use subsetting to display different emojis for different factor levels
ggplot(mtcars, aes(wt, mpg))+
geom_emoji(data = mtcars[mtcars$am==1, ], emoji = "1f697") +
geom_emoji(data = mtcars[mtcars$am==0, ], emoji = "1f68c")
https://twitter.com/OttawaFieldNat/status/409695678781091840
@pboesu
pboesu / regex
Last active February 25, 2016 22:25
helpful regex
\[[^\]]+\] #everything within square brackets http://regexr.com/3csqg
### Title: Back to basics: High quality plots using base R graphics
### An interactive tutorial for the Davis R Users Group meeting on April 24, 2015
###
### Date created: 20150418
### Last updated: 20150423
###
### Author: Michael Koontz
### Email: mikoontz@gmail.com
### Twitter: @michaeljkoontz
###
require(quantmod)
require(fAssets)
#get asian currency data from the FED FRED data series
getSymbols("DEXKOUS",src="FRED") #load Korea
getSymbols("DEXMAUS",src="FRED") #load Malaysia
getSymbols("DEXSIUS",src="FRED") #load Singapore
getSymbols("DEXTAUS",src="FRED") #load Taiwan
getSymbols("DEXCHUS",src="FRED") #load China
getSymbols("DEXJPUS",src="FRED") #load Japan