无法渲染动画 [英] Fail to render an animation

查看:364
本文介绍了无法渲染动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习如何使用R和gganimate获得漂亮的动画图形,但是遇到一些问题.当我尝试为我的图形制作动画时,R似乎编辑了一些PNG文件,但随后却无法渲染它们.这是我使用的代码示例(tidyverse,gganimate和gifski首先加载):

I'm trying to learn how to get a pretty animate graphic using R and gganimate, and I encounter some issue. When I try to animate my graphics, R seems to edit few PNG files, but then fail to render them. Here is an example of the code I use (tidyverse, gganimate, and gifski were loaded first):

p <- ggplot(iris, aes(Sepal.Length, Petal.Length)) + geom_point()
p + transition_states(Species)

R运行第一行没有问题.当涉及到第二行时,控制台将打印"rendering ----".等",倒数秒.一旦结束,它会打印很多行,似乎在描述动画对象(PNG文件列表,状态列表等).我猜这很正常.

R run the first line without issue. When it comes to the second line, console prints "rendering ----> etc.", with a countdown for a few seconds. Once it's over, it prints a lots of lines, which seems to describe the animated object (a list of PNG files, a list of states, etc.). I am guessing that's normal.

最后,在我看来这是问题所在,R给我警告消息:

Finally, and it seems to me it is the issue, R give me a warning message:

file_renderer failed to copy frames to the destination directory

当然,我没有动画.

我看到了其他与此相关的主题,说这可能是一个许可问题,但我不足以理解该怎么做.我在两台计算机上重现了该问题,一台在Ubuntu上,另一台在Windows上.

I saw other subjects about this, saying maybe it is a permission issue, but I am not good enough to understand what to do. I reproduced the issue on two machines, one on Ubuntu, the other on Windows.

推荐答案

我真的不明白为什么,但是问题已经解决了.在两台计算机和两个OS上,现在都可以使用相同的代码.我没有做任何更改,所以无法说出原因是什么,这很奇怪,因为两台机器没有任何共同之处.但是,他们两天前都无法创建动画,而现在他们都可以.

I really do not get why, but the problem have been solved by itself. On both computers, and both OS, the same code is now working. I didn't change anything, so can't tell what is the reason, and it's very weird because the two machines have nothing in common. Yet, they both couldn't create an animation two days ago, and they both can now.

结论:如果有人遇到同样的问题,也许稍后再重试一次?

Conclusion : if anyone have the same issue, maybe just retry a bit later ?

结论2:也许我只是愚蠢,但是我可以用一种解释来知道为什么:)

Conclusion 2: maybe I am just stupid, but I could use an explanation to know why then :)

这篇关于无法渲染动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆