View pypi_upload.sh
python setup.py bdist_wheel
twine upload dist/*.whl
View install_vbox_guest_additions.sh
#!/usr/bin/env bash
vbga_ver="$(curl http://download.virtualbox.org/virtualbox/LATEST.TXT)"
curl http://download.virtualbox.org/virtualbox/${vbga_ver}/VBoxGuestAdditions_${vbga_ver}.iso -o /tmp/vbga.iso
sudo mount -t iso9660 /tmp/vbga.iso /mnt/
sudo /mnt/VBoxLinuxAdditions.run
View install_rundeck.sh
#!/usr/bin/env bash
wget -q -O - https://bintray.com/user/downloadSubjectPublicKey?username=bintray | sudo apt-key add -
echo 'deb http://dl.bintray.com/rundeck/rundeck-deb /' | sudo tee -a /etc/apt/sources.list.d/rundeck.list
echo 'deb-src http://dl.bintray.com/rundeck/rundeck-deb /' | sudo tee -a /etc/apt/sources.list.d/rundeck.list
sudo apt-get -y update
sudo apt-get -y install rundeck
View bayes_factor.cpp
// [[Rcpp::plugins("cpp11")]]
#include <Rcpp.h>
using namespace Rcpp;
double bf(NumericVector v, int n) {
int h = sum(rbeta(n, 1 + v[0], 1 + v[1]) > rbeta(n, 1 + v[2], 1 + v[3]));
if (h == n) {
return R_PosInf;
} else {
View mcmc_logit.R
#!/usr/bin/env Rscript
sapply(c('dplyr', 'data.table', 'MASS', 'MCMCpack'), function(p) require(p, character.only = TRUE))
# Biopsy Data on Breast Cancer Patients
#
# variables:
# 'V1' clump thickness.
# 'V4' marginal adhesion.
# 'class' "benign" or "malignant".
View glm_confint.R
#!/usr/bin/env Rscript
# Diabetes survey on Pima Indians
#
# variables:
# 'glucose' Plasma glucose concentration at 2 hours in an oral glucose tolerance test
# 'diabetes' Diabetes pedigree function
# 'test' test whether the patient shows signs of diabetes (coded 0 if negative, 1 if positive)
data(pima, package = 'faraway')
View heatmap.R
#!/usr/bin/env Rscript
sapply(c('data.table', 'ggplot2'), function(p) require(p, character.only = TRUE))
mtx <- fread('matrix.csv')
heatmap <- ggplot(mtx, aes(x = col, y = row, fill = val)) +
geom_tile() +
scale_fill_gradient(trans = 'log', breaks = c(10, 100, 1000), low = 'grey', high = 'blue') +
labs(x = 'col', y = 'row')
View forest_plot.R
#!/usr/bin/env Rscript
sapply(c('data.table', 'ggplot2'), function(p) require(p, character.only = TRUE))
or_ci <- fread('odds_ratio.csv')
forest <- ggplot(or_ci, aes(x = group, y = odds_ratio, ymin = ci_lower, ymax = ci_upper, colour = class)) +
geom_hline(aes(yintercept = 1), colour = '#4400FF', linetype = 2) +
geom_pointrange(size = 0.7, shape = 15) +
scale_y_log10(limits = c(0.01, 100), breaks = c(0.1, 1, 10)) +
View d3_word_clouds.html
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>D3 Word Clouds</title>
<meta name="author" content="d4i"/>
</head>
<body>
<script src="https://rawgit.com/mbostock/d3/master/d3.min.js"></script>
<script src="https://rawgit.com/jasondavies/d3-cloud/master/d3.layout.cloud.js"></script>
View accordion.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Accordion</title>
<meta name="author" content="d4i"/>
<style>
.accordion {
list-style: none;
}