This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mha <- 1 # mean under the alternative | |
es <- 2 # observed effect (deviation from mean under H0) | |
x <- seq(-6, 6, length=1000) | |
dh0 <- dnorm(x, 0, 1) | |
show.it <- function(es, mha, verbose=FALSE) { | |
dh1 <- dnorm(x, mha, 1) | |
plot.new() | |
plot.window(xlim=range(x), ylim=c(0,.6)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Time-stamp: <2010-04-05 17:11:20 chl> | |
# | |
# Automaticaly collate R file and try to build a package with | |
# documentation generated by Roxygen. | |
# | |
require(roxygen) | |
rm(list=ls()) | |
package.skeleton('rocad',code_files=c('rocad.R','rocad-package.R'),force=T) | |
roxygenize('rocad',roxygen.dir='rocad',copy.package=F,unlink.target=F) | |
try(system("R CMD build rocad")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/eliben/4clojure-solutions.git | |
https://github.com/bcc32/99.git | |
https://github.com/politrons/Dive_into_Haskell.git | |
https://github.com/hbctraining/Intro-to-R.git | |
https://github.com/ppham27/MLaPP-solutions.git | |
https://github.com/ArthurZC23/Machine-Learning-A-Probabilistic-Perspective-Solutions.git | |
https://github.com/nayuki/Nayuki-web-published-code.git | |
https://github.com/davidemms/OrthoFinder.git | |
https://github.com/ctgk/PRML.git | |
https://github.com/wentaocn/Programming-in-Haskell.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Note: pdftoppm has page range so the first line is probably not necessary. | |
f="/tmp/tmp.$RANDOM" | |
pdftk "$1" cat $2 output $f | |
pdfcrop $f $f.crop | |
pdftoppm -png -rx 300 -ry 300 $f.crop $HOME/"$1".png | |
rm $f $f.crop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import statistics | |
import sys | |
from Bio import SeqIO | |
term_width = os.get_terminal_size().columns | |
term_height = os.get_terminal_size().lines | |
id_width = 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; org-babel.el --- default settings for org->pdf compilation | |
;;; | |
;;; Commentary: | |
;;; This is very basic stuff. | |
;;; | |
;;; Code: | |
(require 'org) | |
(add-to-list 'load-path "/home/chl/Documents/notes") | |
(require 'ox-bibtex) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(mixOmics) | |
library(RColorbrewer) | |
X <- replicate(6, rnorm(50)) | |
X.row.mds <- cmdscale(dist(X), k=1) | |
X.col.mds <- cmdscale(dist(t(X)), k=1) | |
cim(cor(X)[order(X.col.mds),order(X.col.mds)], col=rev(brewer.pal(8, "RdBu"))) | |
cim(cor(t(X))[order(X.row.mds),order(X.row.mds)], col=rev(brewer.pal(8, "RdBu"))) | |
cim(X, col=rev(brewer.pal(8, "RdBu")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@article{arlot2010survey, | |
Author = {Arlot, S. and Celisse, A.}, | |
Journal = {Statistics Surveys}, | |
Pages = {40--79}, | |
Title = {A survey of cross-validation procedures for model selection}, | |
Volume = {4}, | |
Year = {2010}} | |
@article{feinerer2008text, | |
Author = {Feinerer, I. and Hornik, K. and Meyer, D.}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Time-stamp: <2011-01-07 12:41:47 chl> | |
# | |
# Some illustrations of SQL joins with R. | |
# Inspiration: Jeff Atwood, http://bit.ly/eMhJEp | |
# | |
tableA <- data.frame(id=1:4, name=c("Pirate","Monkey","Ninja","Spaghetti")) | |
tableB <- data.frame(id=1:4, name=c("Rutabaga","Pirate","Darth Vader","Ninja")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Some illustrations of reliability analysis. | |
# Time-stamp: <2010-10-17 21:35:51 chl> | |
x <- c(12,8,22,10,10,6,8,4,14,6,2,22,12,7,24,14,8,4,5,6,14,5,5,16) | |
GHQ <- data.frame(subject=gl(12,1,24), time=gl(2,12), score=x) | |
# ---------------------------------------------------- | |
# Computing reliability (Rx) by hand from ANOVA tables | |
# ---------------------------------------------------- | |
# one-way ANOVA (assuming no time trends) | |
summary(aov(score ~ subject, data=GHQ)) |
NewerOlder