我想学习如何创建一个简单的GIF。 我找到了这段代码:
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()
创建了11个png图像。我想从这11个图像中创建一个GIF文件,所以我使用的是system("convert -delay 80 *.png example_1.gif")
。但是我收到了错误
> 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
我也看过Creating a Movie from a Series of Plots in R;但这对我也不起作用。
P.S。我已经安装了ImageMagick
答案 0 :(得分:1)
尝试运行system("convert /?")
以查看问题的根源!!!
Converts a FAT volume to NTFS.
CONVERT volume /FS:NTFS [/V] [/CvtArea:filename] [/NoSecurity] [/X]
volume Specifies the drive letter (followed by a colon),
mount point, or volume name.
/FS:NTFS Specifies that the volume will be converted to NTFS.
/V Specifies that Convert will be run in verbose mode.
/CvtArea:filename
Specifies a contiguous file in the root directory
that will be the place holder for NTFS system files.
/NoSecurity Specifies that the security settings on the converted
files and directories allow access by all users.
/X Forces the volume to dismount first if necessary.
All open handles to the volume will not be valid.
如果您安装了ImageMagick版本7,那么此行应该可以解决问题。
system("magick -delay 80 *.png example_1.gif")