This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(e1071) | |
library(gganimate) | |
# take a vector of inputs and return a binary | |
# matrix corresponding to the character | |
read_letter <- function(...) { | |
cbind( | |
matrix(data = c(...), nrow = 9, ncol = 5, byrow = TRUE), | |
matrix(data = rep(0,9), nrow = 9, ncol = 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(e1071) | |
library(gganimate) | |
library(viridis) | |
ascii_bridge <- " | |
.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,1,1,1,1,1,1,1,1,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,. | |
.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,1,1,1,1,.,1,.,.,.,.,1,.,1,1,1,1,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,. | |
.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,1,1,1,1,.,.,.,.,1,.,.,.,.,1,.,.,.,.,1,1,1,1,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,. | |
.,.,.,.,.,.,.,.,.,.,.,.,.,.,1,1,.,.,.,1,.,.,.,.,1,.,.,.,.,1,.,.,.,.,1,.,.,.,1,1,.,.,.,.,.,.,.,.,.,.,.,.,.,. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ambient) | |
library(imager) | |
library(tidyverse) | |
library(gganimate) | |
make_noise_frame <- function(n=500, fr=1, type = "worley") { | |
if(type == "worley") { | |
noise <- noise_worley( | |
dim = c(n, n), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script for tidying data pulled from Google App Engine. Typically the raw format | |
# has a "content" field, and each entry in it is a text string describing the | |
# complete data set from one person in CSV format. | |
library(tidyverse) | |
my_data <- read_csv("results.csv") %>% | |
pull("content") %>% | |
map_dfr(read_csv, col_types = cols(.default = "c")) %>% | |
write_csv("tidy_results.csv") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(gganimate) | |
# initial frame | |
last_tbl<- tibble( | |
letter = c("T","H","A","N","K","Y","O","U"), | |
x_pos = c(1,2,3,4,5,2,3,4), | |
y_pos = c(3,3,3,3,3,2,2,2), | |
id = 1:8, | |
fr = 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from Claus Wilke's code | |
# https://github.com/clauswilke/isoband | |
library(isoband) | |
library(magick) | |
library(sf) | |
library(tidyverse) | |
# my twitter profile | |
img_loc <- "https://pbs.twimg.com/profile_images/1088575199568584704/zGiMgFB7_400x400.jpg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# devtools::install_github("yixuan/fontr") | |
library(fontr) | |
library(transformr) | |
library(showtext) | |
library(tidyverse) | |
library(gganimate) | |
# use showtext to loading Google fonts (http://www.google.com/fonts) | |
font_add_google("Allura") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(isoband) | |
library(magick) | |
library(sf) | |
library(tidyverse) | |
# Adapted from Claus Wilke's code | |
# https://github.com/clauswilke/isoband | |
sf_from_image <- function(image, nbands) { | |
image_gray <- image %>% image_quantize(colorspace = "gray") | |
image_raster <- as.raster(image_gray) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(transformr) | |
library(tweenr) | |
library(animation) | |
# function to generate lissajous curves in a format | |
# suitable for later tweening | |
lissajous <- function(a=1, b=1, w=1, d=pi/2, t0=-pi, t1=pi, n=100) { | |
tibble( | |
t = seq(t0, t1, length.out = n), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(showtext) | |
library(fontr) | |
library(tidyverse) | |
library(transformr) | |
library(animation) | |
library(ggpolypath) | |
# use showfont to load the font | |
font_add_google("Allura") |
OlderNewer