该包gganimate创建 gifs(来自此处的 MWE 代码):
library(ggplot2)
#devtools::install_github('thomasp85/gganimate')
library(gganimate)
p <- 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')
现在怎么能导出这个gif?在以前的(现在存档的)版本中,gganimate这很简单:
gganimate(p, "output.gif")
gganimate但是,我在当前包中找不到等效功能。
注意:这个问题似乎与我从中获取 MWE 代码的问题完全相同。但是,gganimate已更新,在新版本中,在查看器窗格中显示动画与导出动画似乎是不同的问题。

