r-gganimate尝试失败,在向ggplot添加元素时出错



我正在尝试为地图设置动画,但未能执行transition_states函数。

> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
library(gganimate)
#> Loading required package: ggplot2
# We'll start with a static plot
p <- ggplot(iris, aes(x = Petal.Width, y = Petal.Length)) + 
geom_point()
plot(p)
anim <- p + 
transition_states(Species,
transition_length = 2,
state_length = 1)
Error: Don't know how to add transition_states(Species, transition_length = 2, state_length = 1) to a plot

不幸的是,这个错误很模糊,在这里(或其他地方(几乎没有适用的问题。我渴望得到任何关于去哪里找的建议。

gganimate在安装ggtern的情况下无法正常工作。一旦我删除了ggtern,gganimate就如预期的那样工作了。

最新更新