I hereby claim:
- I am dgrtwo on github.
- I am drobinson (https://keybase.io/drobinson) on keybase.
- I have a public key whose fingerprint is 2BFD FAC9 CDA9 669F FE2C 6973 C0B7 A65C CA30 6675
To claim this, I am signing this object:
# 100,000 simulations | |
n <- 1e5 | |
dice <- t(rmultinom(n, 5, rep(1, 6) / 6)) | |
# First rules for 1s and 5s | |
ones_score <- c(0, 100, 200, 1000, 5000, 10000)[dice[, 1] + 1L] | |
fives_score <- c(0, 50, 100, 0, 0, 0)[dice[, 5] + 1L] | |
# 100 x n score | |
most_common <- apply(dice, 1, which.max) |
# Code behind this tweet: https://twitter.com/drob/status/1100182329350336513 | |
library(tidyverse) | |
library(gganimate) | |
# Setup | |
options(gganimate.nframes = 200) | |
set.seed(2019) | |
simulation <- tibble(roll = 1:10000) %>% | |
mutate(result = sample(6, n(), replace = TRUE)) %>% |
# Code behind this tweet: | |
# https://twitter.com/drob/status/1126988304090574848 | |
library(tidyverse) | |
library(broom) | |
t_tests <- crossing(pi0 = .75, | |
effect_size = .25, | |
trial = 1:10000, |
--- | |
title: "Effect of compression type and file complexity on saveRDS size and speed" | |
author: "David Robinson" | |
date: "April 20, 2015" | |
output: html_document | |
--- | |
```{r echo = FALSE} | |
knitr::opts_chunk$set(cache = TRUE, message = FALSE) | |
``` |
separate_sql <- function(expression) { | |
s <- paste(deparse(expression), collapse = "\n") | |
s <- stringr::str_replace(s, "%>%", "%>%\n ") | |
s <- stringr::str_split(s, "\n")[[1]] | |
val <- eval(expression) | |
list(expression = expression, | |
dplyr_code = s, | |
sql = as.character(dbplyr:::remote_query(val)), |
I hereby claim:
To claim this, I am signing this object:
""" | |
barcode_splitter.py | |
Barcode splitter for fastq sequencing files, that matches using Levenshtein | |
distance. | |
USAGE: | |
python barcode_splitter.py reads.fastq index_reads.fastq barcodes.txt |
library(purrr) | |
transition_mc <- function(steps, start, mat) { | |
i <- seq_len(nrow(mat)) | |
transition <- ~ sample(i, 1, prob = (i == .) %*% mat) | |
accumulate(seq_len(steps), transition, .init = start) | |
} |
--- | |
title: "R Notebook" | |
output: html_notebook | |
--- | |
```{r} | |
library(purrr) | |
transition_mc <- function(steps, start, mat) { | |
i <- seq_len(nrow(mat)) |
library(ggplot2) | |
library(igraph) | |
library(ggraph) | |
library(scales) | |
library(ggforce) | |
network_theme <- theme_no_axes() + | |
theme(panel.border = element_blank()) | |
theme_set(network_theme) |