Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does this gganimate code locked binding error?

I'm using gganimate for the first time and I'm just trying to run the example code from the github, which is this:

library(ggplot2)
library(gganimate)
ggplot(mtcars, aes(factor(cyl), mpg)) + 
geom_boxplot() + 
# Here comes the gganimate code
transition_states(
gear,
transition_length = 2,
state_length = 1
) +
enter_fade() + 
exit_shrink() +
ease_aes('sine-in-out')

But I get an error when I try to run it. (It's the same error I try to do anything with gganimate.) It's this:

Error in gifski_first_error <<- FALSE : 
cannot change value of locked binding for 
'gifski_first_error'

Thanks!

like image 761
matt_lnrd Avatar asked Feb 07 '26 04:02

matt_lnrd


1 Answers

I had a similar issue. Try installing the "gifski" and "png" packages, then running the provided code.

The error happens because gifski_renderer() is the current default renderer.

Go here for more information: https://github.com/thomasp85/gganimate/commit/8248357809860c0e1a90eaf1f2ac1cdee1a95a64

like image 127
Nathan Goss Avatar answered Feb 08 '26 17:02

Nathan Goss



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!