Skip to content

Instantly share code, notes, and snippets.

@gonzalezgouveia
Last active June 26, 2019 20:59
Show Gist options
  • Save gonzalezgouveia/62c765dec9e23bfe15b023b422d49629 to your computer and use it in GitHub Desktop.
Save gonzalezgouveia/62c765dec9e23bfe15b023b422d49629 to your computer and use it in GitHub Desktop.
# Hecho con gusto para #DatosDeMiercoles, propuesto por @R4DS_es
# Por Rafa @GonzalezGouveia --> https://bit.ly/2Fnvc7V
library(tidyverse)
library(gganimate)
library(ggthemes)
capitulos_rladies <- readr::read_csv("https://bit.ly/2XxvcN2")
eventos_rladies <- readr::read_csv("https://bit.ly/2xcNXXj")
# colores del tema
ltgray <- "#cccccc"
dkgray <- "#757575"
dkgray2 <- "#666666"
eventos_tidy <- eventos_rladies %>%
select(fecha_local, respuesta_asistire) %>%
arrange(fecha_local) %>%
mutate(respuesta_acumulada = cumsum(respuesta_asistire))
anim <- eventos_tidy %>%
ggplot(aes(x = fecha_local, y = respuesta_acumulada)) +
geom_line(col = 2, lwd = 2) +
xlim(as.Date(c('31/10/2012', '1/1/2020'), format="%d/%m/%Y")) +
labs(title = 'Alcance de R-Ladies en el tiempo',
x = NULL,
y = 'Respuesta acumulada MeetUp') +
theme_gdocs() +
theme(axis.title = element_text(face = "plain",
colour = dkgray2,
size = 20),
axis.text = element_text(face = "plain",
colour = dkgray,
size = 20),
axis.text.y = element_text(angle = 45)
) +
transition_reveal(fecha_local) +
view_follow()
# Comenta un emoji de piña si lograste crear la gráfica! ;)
# regresa al tweet --> https://bit.ly/2xh15uw
# animar
animate(anim,
fps = 50,
nframes = 500,
end_pause = 100)
anim_save('rladies.gif')
# Hecho con gusto para #DatosDeMiercoles, propuesto por @R4DS_es
# Por Rafa @GonzalezGouveia --> https://bit.ly/2Fnvc7V
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment