Getting "attempt to apply non-function" when view_follow() is used. It is working as expected when view_follow() function is removed. I am adding this to adjust y-axis basis for the value plotted on the axis. I appreciate a help.
Reproducible code is given below:
library(plyr)
library(dplyr)
library(ggplot2)
library(reshape)
library(reshape2)
library(gganimate)
samplelData <-
rbind(
cbind.data.frame(
year = as.integer(seq(from=2001,to=2020,by=1)),
Country = c('A'),
value = c(1:20)
),
cbind.data.frame(
year = as.integer(seq(from=2001,to=2020,by=1)),
Country = c('B'),
value = seq(from=10,to=400,by=20)
))
ggplot(samplelData,
aes(
x = Country,
y = value,
fill = Country,
frame = year
)) + geom_point(stat = 'identity', position = 'dodge') +
transition_reveal(year) + view_follow(fixed_x = TRUE) + labs(title = "Year: {round(frame_along, 0)}")