The animated chart does not render properly and it creates the following error messages:
Error occurred in the 1st layer.
Caused by error in unit():
'x' and 'units' must have length > 0
Problem while converting geom to grob.
library(ggplot2)
library(Rcpp)
library(gifski)
library(gganimate)
library(transformr)
library(quantmod)
CHAI <- getSymbols("SBUX" , from="2020-1-1" , to="2021-1-1" , auto.assign=F)
CATROON <- ggplot(CHAI, aes(y=SBUX.Close,x=index(CHAI)))+
geom_area(color="pink", size=1.2 , fill="pink" , alpha=0.3)+
geom_point(color="#8F157E", size=4)+
labs(x="Time", y="Close Price")+
theme_bw() + transition_reveal(index(CHAI))
animate(CARTOON, duration=7 , fps = 30)
The animated chart does not render properly and it creates the following error messages:
Error occurred in the 1st layer.
Caused by error in
unit():'x' and 'units' must have length > 0
Problem while converting geom to grob.