library(tidyverse)
library(gganimate)
set.seed(20200504)
<- 20
locations <- 50
n_stars <- tibble(
tie_data id = rep(seq_len(locations), each = n_stars),
x = rep(runif(locations), each = n_stars),
y = rep(runif(locations), each = n_stars),
star_x = rep(runif(n_stars), locations),
star_y = rep(runif(n_stars), locations),
label = "|-o-|"
)
ggplot(tie_data, aes(x = x, y = y, label = label)) +
geom_point(color = "white", aes(star_x, star_y)) +
geom_text(color = "white", fontface = "bold", size = 12) +
expand_limits(x = c(-0.1, 1.1), y = c(-0.1, 1.1)) +
theme_void() +
theme(panel.background = element_rect(fill = "black")) +
transition_states(id, transition_length = 4, state_length = 1)
May the Fourth Be With You (#rstats style)
Happy Star Wars Day!
Rafael Irizarry has made a fabulous TIE fighter plot.
Happy #MayFourth #rstats
— Rafael Irizarry (@rafalab) May 4, 2018
par(bg=1,fg="white")
x<-0.5->y
z<-"|-o-|"
s<-cbind(runif(50),runif(50))
m<-c(-1,1)/20
while(TRUE){
rafalib::nullplot(xaxt="n",yaxt="n",bty="n")
points(s,pch=".")
text(x,y,z, cex=4)
x<-pmin(pmax(x+sample(m,1),0),1)
y<-pmin(pmax(y+sample(m,1),0),1)
} pic.twitter.com/2kBwklMjTy
Jake Thompson recreated this plot using the {gganimate} package. I posted this amazing recreation in celebration of Star Wars Day (May the Fourth be with YOU!), and Rafa pointed out that the stars are missing!
Where are the stars ✨ though? 😁
— Rafael Irizarry (@rafalab) May 4, 2020
So I’ve taken it upon myself to add them. Here you go!
Check out the other amazing Star Wars - R content from the fabulous #rstats community!
Happy #MayThe4th! In honor of this special day, I've curated a list of my favorite #StarWars and #rstats crossovers 💕
— Lucy D’Agostino McGowan (@LucyStats) May 4, 2020
🧵 1/n pic.twitter.com/A4HTZesxl8