I would like to learn how to create a simple GIF. I found this code :
dir.create("examples")
setwd("examples")
# example 1: simple animated countdown from 10 to "GO!".
png(file="example%02d.png", width=200, height=200)
for (i in c(10:1, "G0!")){
plot.new()
text(.5, .5, i, cex = 6)
}
dev.off()
which creates 11 png images. I would like to create a GIF file from these 11 eleven images, so I am using system("convert -delay 80 *.png example_1.gif")
. But I get an error
> system("convert -delay 80 *.png example_1.gif")
Invalid Parameter - 80
Warning message:
running command 'convert -delay 80 *.png example_1.gif' had status 4
I have also looked at Creating a Movie from a Series of Plots in R; but this does not work for me either.
P.S. I have already installed ImageMagick