Skip to content

Instantly share code, notes, and snippets.

@thomaskern
thomaskern / test
Created April 18, 2014 21:20
tesxt
# foo & blah
@thomaskern
thomaskern / cuts.r
Last active December 24, 2015 22:49
cutie = cut(df$volume,c(0,216,433,650,867,29000))
ggplot(df,aes(type,change,fill=cutie)) + geom_hline(yintercept=0,color="white",size=1)+ geom_bar(stat="identity") + coord_flip() + theme(panel.grid.major.y=element_blank(),legend.position=c(.9,0.3),legend.background=element_rect(fill="transparent")) + labs(x="",y="Change [%]",title="Change in New Brunswick Fruit Production - 2006 vs 2011") + scale_y_continuous(breaks=seq(-25,100,25)) + theme(plot.margin = unit(c(0.3, 0.3, -0.03, -0.15), "lines")) + scale_fill_manual("Volume [ac]",values=c("#B2CDDF","#5E9CCB","#2F6BAC","#173987","black"),breaks=c("(0,216]","(216,433]","(433,650]","(650,867]","(867,2.9e+04]"),labels=c("< 220","221-430","431-650","651-900","29k"))
~ » whence -f zle-keymap-select
zle-keymap-select () {
VIMODE="${${KEYMAP/vicmd/ M:command}/(main|viins)/}"
zle reset-prompt
}
day,type,percentage
0,1,40
0,1,40
0,1,40
0,1,40
0,1,40
0,1,40
0,1,40
0,1,40
1,1,40
~ » lein repl
Downloading Leiningen now...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9425k 100 9425k 0 0 5471k 0 0:00:01 0:00:01 --:--:-- 10.5M
java.lang.ClassNotFoundException
- klass: 'java/lang/ClassNotFoundException'
rlwrap: warning: java killed by SIGTRAP.
rlwrap has not crashed, but for transparency,
it will now kill itself (without dumping core)with the same signal
~ » lein
java.lang.ClassNotFoundException
- klass: 'java/lang/ClassNotFoundException'
rlwrap: warning: java killed by SIGTRAP.
rlwrap has not crashed, but for transparency,
it will now kill itself (without dumping core)with the same signal
/Users/bosie/bin/lein: line 292: 74752 Trace/BPT trap: 5 $RLWRAP $LEIN_JAVA_CMD -Xbootclasspath/a:"$CLOJURE_JAR" -client $LEIN_JVM_OPTS -XX:+TieredCompilation -Dleiningen.original.pwd="$ORIGINAL_PWD" -Dleiningen.trampoline-file=$TRAMPOLINE_FILE -cp "$CLASSPATH" $JLINE clojure.main -e "(use 'leiningen.core)(-main)" $NULL_DEVICE "$@"
9-GRAIN WHEAT Enriched Wheat Flour (Wheat Flour, Malted Barley Flour, Niacin, Iron, Thiamine
Mononitrate, Riboflavin, Folic Acid), Water, High Fructose Corn Syrup, Whole Wheat Flour, Contains
2% Or Less Of The Following: Wheat Gluten, Oat Fiber, Yeast, Soybean Oil, Wheat Bran, Calcium
Blend (Calcium Carbonate, Vitamin D3), Salt, Rolled Wheat, Rye Nuggets, Dough Conditioners
(Datem, Sodium Stearoyl Lactylate), Yeast Nutrients (Calcium Sulfate, Ammonium Sulfate), Degermed
Yellow Corn Meal, Rolled Oats, Rye Flakes, Caramel Color, Triticale Flakes, Parboiled Brown Rice,
Refinery Syrup, Honey, Barley Flakes, Flaxseed, Millet, Sorghum Flour, Flavor (Yeast Extract, Salt,
Natural Flavor
library(ggplot2)
data = data.frame(x=rep(c("M1", "M2","M3","M4"),3), y=runif(12,10,20), group=c(rep("B",3), rep("A",3), rep("C",3),rep("D",3)))
p = ggplot(data,aes(x=x,y=y))
p = p + facet_grid(. ~ group)
p = p + geom_point()
print(p)
library(ggplot2)
data = data.frame(x = 1:50, y = runif(50,1,10), colour=c(rep("A",25),rep("B",25)), group=rep(1:2,25))
p <- ggplot(data,aes(x=colour,y=y, colour = colour))
p = p + xlab("Section") + ylab("F1") + opts(axis.title.x = theme_text(vjust=0))
p = p + opts(plot.margin = unit(c(-0.65,0.1,0.15,0.35),"cm"))
p = p + facet_grid(group ~ .,space="free",scales="free")
p = p + scale_size(to= c(1.5,3), legend=F)
p = p + geom_jitter()
grid.gedit(size=unit(5, "mm"), "key.points", grep=T)
library(ggplot2)
section = c(
rep(1,75),
rep(2,25),
rep(3,400),
rep(4,100)
)
data = data.frame(x=1:600,y=runif(600,50,200),Section=section)