Open MichaelChirico opened 4 years ago
Hi,
This problem is introduced by the Magick package.
In magick::image_animate
function, fps
must be a factor of 100, https://github.com/ropensci/magick/blob/master/R/animation.R#L37
I don't know why the author set this as default, but in animation
package, you always have another choice.
You can avoid this problem by using the ImageMagick convert function. First of all, please make sure you installed ImageMagick convert
function in your local machine (some special tips: http://www.imagemagick.org/discourse-server/viewtopic.php?t=29582).
Then run the code below.
library(animation)
nn = 720L
saveGIF({for (ii in 1:nn) plot(runif(10), ylim = 0:1)},
interval = 5/nn,
convert="convert")
I was trying to plot many frames and target the output to be a certain length (5 seconds):
This then failed:
Quite strange. However, the stack trace gives a lot clearer understanding:
In particular:
Will give
Inf
sinceinterval < 1/100
soas.integer
will truncate to 0.It would be helpful if this were pointed out sooner