Skip to content

Instantly share code, notes, and snippets.

@coolbutuseless
Last active July 31, 2018 10:58
Show Gist options
  • Save coolbutuseless/568f05d99cc38a6be36bfc38380c2fec to your computer and use it in GitHub Desktop.
Save coolbutuseless/568f05d99cc38a6be36bfc38380c2fec to your computer and use it in GitHub Desktop.
brailler plotter in a tweet
#rstats
library(tidyverse)
d=c(1,5,3,11,9,7,15,13,6,14)
d=c(d,d+16,d+48,d+32)
L=setNames(c(1:22,40,23:25),letters)
D=map(d[L[strsplit('braille','')[[1]]]],~intToBits(.x)[1:6]>0)
P=data.frame(D=unlist(D),x=0:1+rep(seq(D),e=6)*3,y=rep(2:0,e=2))
ggplot(P)+geom_point(aes(x,y,size=D))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment