Я обычно генерирую кучу анимаций, используя gganimate, и помещаю их в html для показа на моем сервере отчетов.
Я хотел бы объединить все анимации вместо того, чтобы иметь страницу для каждой из них, используя R.
Я следую за ответом на этот запрос функции на GitHub, который @ ThomasP85 (создатель пакета gganimate) написал относительно этой проблемы:
https://github.com/thomasp85/gganimate/issues/238
Используя два примера с сайта gganimate github:
library(ggplot2)
library(gganimate)
FirstPlot <- ggplot(mtcars, aes(factor(cyl), mpg)) +
geom_boxplot() +
# Here comes the gganimate code
transition_states(
gear,
transition_length = 2,
state_length = 1
) +
enter_fade() +
exit_shrink() +
ease_aes('sine-in-out')
SecondPlot <- ggplot(airq, aes(Day, Temp, group = Month)) +
geom_line() +
geom_segment(aes(xend = 31, yend = Temp), linetype = 2, colour = 'grey') +
geom_point(size = 2) +
geom_text(aes(x = 31.1, label = Month), hjust = 0) +
transition_reveal(Day) +
coord_cartesian(clip = 'off') +
labs(title = 'Temperature in New York', y = 'Temperature (°F)') +
theme_minimal() +
theme(plot.margin = margin(5.5, 40, 5.5, 5.5))
animate(list=(FirstPlot,SecondPlot ), renderer = gifski_renderer(loop = FALSE))
Но пока безуспешно.