I'm relatively new to gganimate and I'm trying to create a simple polynomial time-series graph on R studio.
x <- 1:100
f <- function (x){
return(-(x)^2)
}
df <- data.frame(x, y= -(x)^2)
ggplot(df, aes(x, y)) +
geom_line() +
stat_function(fun=f) +
transition_states(x, transition_length = 1, state_length = 2 )
My error shows:
" Error in transform_path(all_frames, next_state, ease, params$transition_length[i], :
transformr is required to tween paths and lines "
I'm wondering if there's something missing in transition_state() ? It appears fine as a static graph but I'd like to make it a time-series graph.
Appreciate any advice / help!! Thank you !
See https://github.com/thomasp85/gganimate/issues/190 and https://community.rstudio.com/t/error-dependency-transformr-is-not-available-for-package-gganimate/11134: the package transformr
is required to apply transform_path
to geom_line()
devtools::install_github("thomasp85/transformr")