gganimate不显示任何内容

时间:2019-03-20 17:12:27

标签: r ggplot2 gganimate

由于收到消息,我已经安装了transformrgifski软件包。为什么下面的代码不起作用?我收到很多消息:

geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic?

library(gapminder)
library(gganimate)
library(gifski)
library(transformr)
library(dplyr)   # For %>%  and  filter  and  %in%
library(ggplot2) 

gapminder %>% 
  filter(country %in% c("Afghanistan", "United States")) %>% 
  ggplot() +
  geom_line(aes(year, pop, group=country)) + 
  transition_time(year)

1 个答案:

答案 0 :(得分:0)

我已经解决了问题。我需要使用transition_reveal而不是transition_time