Watts-College / cpp-527-spr-2022

https://watts-college.github.io/cpp-527-spr-2022/
0 stars 1 forks source link

Error in magick:: image_animate(img, loop = loop, fps = 100/as.integer(interval * : argument 'fps' must be a factor of 100 #20

Open chmao99 opened 2 years ago

chmao99 commented 2 years ago

Hi Professor @Dselby86,

When I try to use "saveGIF()" creating a animation, I got an error above mentioned in the title. I have installed Image Magick according to the instruction. My code was pasted below. What shall I do? Would you please help me out? Thanks in advance!

` dir.create("d:/asu/cpp527/gifs") setwd("d:/asu/cpp527/gifs") library("animation")

cash <- 10
results <- NULL count <- 1

saveGIF({

while( cash > 0 ) { cash <- cash +
sample( c(-1,0,1), size=1 )
results[count] <- cash
plot(1:count, results[1:count], type = "l", xlim = c(1,1000), ylim = c(0, 40)) count <- count + 1
}

},

movie.name = "game.gif", # name of your gif interval = 0.3, # controls the animation speed ani.width = 800, # size of the gif in pixels ani.height = 800 ) # size of the git in pixels `