Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Uses the asciify package to draw the "Bayesian rain" animation in the RStudio viewer pane
#devtools::install_github("djnavarro/asciify")
library(asciify)
library(magrittr)
temporary <- function(file) {
temp_dir <- tempfile()
dir.create(temp_dir)
file.path(temp_dir, file)
}
in_viewer <- function(file) {
viewer <- getOption("viewer")
viewer(url = file)
}
loc <- temporary("bayes_rain.html")
ascii_data("bayes.png") %>%
ascii_map(rescale = .3) %>%
ascii_grid() %>%
ascii_rain(file = loc)
in_viewer(loc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.