The code is fine when running in R studio. However, there is no gif but messy codes when running in vscode. I have configured R extension and httpgd well and png plot is shown normally.
geom_boxplot() +
transition_states(
gear,
transition_length = 2,
state_length = 1
) +
enter_fade() +
exit_shrink() +
ease_aes("sine-in-out")