Skip to content

Instantly share code, notes, and snippets.

View muschellij2's full-sized avatar

John Muschelli muschellij2

View GitHub Profile
@muschellij2
muschellij2 / walk_source.R
Last active February 20, 2020 21:14 — forked from gadenbuie/walk_source.R
Walk an R source file and run each command in RStudio automatically on a delay
walk_source <- function(
file = NULL,
delay = 1.5,
clear_each_cmd = TRUE,
wait_for_press = TRUE,
style = styler::tidyverse_style,
record_screen = TRUE,
...
) {
if (record_screen) {
## Performs MCMC P-value calculation for 0-1 tables
## from Darwin's Finch data
set.seed(1)
I = 7; J = 5
testDat = matrix(sample(0:1, I * J, replace= TRUE), I, J)
A = matrix(c(
0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,