我使用以下代码生成GIF图像:
library(animation)
saveGIF({
for(i in 2:416)
{
data<-c(MatrixY[,i])
x.specA<-spectrum(data,plot=FALSE)
print(paste(i))
z<-matrix(x.specA$spec,nrow=length(x),ncol=length(y))
persp(x,y,z, theta = 30, phi = 30, expand = 0.5, col = "lightblue")
}
},
movie.name = "test.gif",
interval = 0.1,
ani.width = 500,
ani.height = 500,)
是否可以将此gif图像保存在硬盘上?