Skip to content

Instantly share code, notes, and snippets.

@sa-lee
Created August 14, 2018 18:34
Show Gist options
  • Save sa-lee/c271b47d8065412d3d42c1ad8e63048d to your computer and use it in GitHub Desktop.
Save sa-lee/c271b47d8065412d3d42c1ad8e63048d to your computer and use it in GitHub Desktop.
library(nullabor)
library(gganimate)
library(magrittr)
p <- mtcars %>%
rorschach(method = null_permute("mpg"), n = 20, true = .) %>%
ggplot() +
geom_boxplot(aes(x = factor(cyl), y = mpg, fill = factor(cyl))) +
theme(legend.position = 'none', aspect.ratio = 1) +
xlab("cyl")
in_space <- p +facet_wrap(~.sample)
# ggsave("rorsach.png", in_space)
in_time <- p + transition_states(.sample, 3, 1)
animate(in_time, fps=8, width=400, height=400)
# anim_save(filename = "hop.gif")
@sa-lee
Copy link
Author

sa-lee commented Aug 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment