【发布时间】:2020-04-02 20:14:04
【问题描述】:
我正在尝试为地图制作动画,但未能执行 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 的包。谢谢第二个意见。当我了解更多时,我会更新。