gganimate没有显示任何内容

问题描述 投票:0回答:1

由于我的消息,我已经安装了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)
r ggplot2 gganimate
1个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.