# NOT RUN {
anim <- ggplot(mtcars, aes(mpg, disp)) +
transition_states(gear, transition_length = 2, state_length = 1) +
enter_fade() +
exit_fade()
# }
# NOT RUN {
# Default uses linear easing
animate(anim)
# }
# NOT RUN {
# Change all to 'cubic-in-out' for a smoother appearance
anim1 <- anim +
ease_aes('cubic-in-out')
# }
# NOT RUN {
animate(anim1)
# }
# NOT RUN {
# Only change easing of y variables
anim2 <- anim +
ease_aes(y = 'bounce-in')
# }
# NOT RUN {
animate(anim2)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab