Skip to content

Instantly share code, notes, and snippets.

View muschellij2's full-sized avatar

John Muschelli muschellij2

View GitHub Profile
@gadenbuie
gadenbuie / walk_source.R
Last active February 21, 2020 17:40
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,
style = styler::tidyverse_style
) {
options("walk_source_cancel" = FALSE)
if (is.null(file)) {
txt <- rstudioapi::getSourceEditorContext()$contents
} else {