3

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!

matt_lnrd
  • 329
  • 1
  • 9

1 Answers1

4

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