View install_R_deps.sh
#!/bin/bash | |
echo "i <- rownames(installed.packages())" > __tmp__.R | |
grep -oh --include=\*.{Rmd,R} -r * -e "\(library\|require\)([A-Za-z0-9.]\+)" | \ | |
sed 's_library(_"_' | \ | |
sed 's_require(_"_' | \ | |
sed 's_)_",_' | sort | uniq | \ | |
perl -p -e 's/\n/ /' | \ | |
sed 's_^_new <- c(_' | \ |
View colmean
#!/bin/bash | |
SEP="," | |
HEADER=true | |
STDERR=false | |
while [ "$#" -gt 0 ]; do | |
case "$1" in | |
-s) SEP="$2"; shift 2;; | |
-c) COL="$2"; shift 2;; |
View how_many_imputations.R
# This gist has been superceded by the howManyImputations package (https://github.com/josherrickson/howManyImputations). |
View ggheatmap.R
library(dplyr) | |
library(reshape2) | |
library(ggplot2) | |
#' Create a heatmap in ggplot2 | |
#' | |
#' @param data Data set | |
#' @param print.cors Default TRUE. Should the correlations be printed in each block of the heatmap? | |
#' @param reoder Default TRUE. Should the entries be re-ordered via clustering, similar to `heatmap`? | |
#' @param colors Default c("red", "white", "blue"). Vector of length three defining colors for correaltions (1, 0, -1). | |
#' |