Animation in a gitplot knitr document

I am trying to use the following snippet in my knitr document that creates pdf

<<animate_gg,fig.show='animate', eval=TRUE>>= gg.list<-list() for (w.it in w.vals){ sub.final.pts.lf.logical<-all.final.pts.lf$w %in% w.it sub.final.pts.lf<- all.final.pts.lf[sub.final.pts.lf.logical,] levels(sub.final.pts.lf$w)<- paste("w=",levels(sub.final.pts.lf$w)) g1<-ggplot(sub.final.pts.lf,aes(x=x,y=y,colour=pt.name))+geom_point(alpha = 1/5) +scale_shape(solid = FALSE) gg.list<-c(gg.list,list(g1)) } for (gg in gg.list){ gg } 

however, this does not create any relevant section in latex. I assume the problem is that if I use gg inside brackets, R does not evaluate this line. The following creates a single graph animation

  { g1<-ggplot(sub.final.pts.lf,aes(x=x,y=y,colour=pt.name))+geom_point(alpha = 1/5) +scale_shape(solid = FALSE) } g1 

How to create an animation with all created charts?

+6
source share
1 answer

top FAQ (7.22) for grid based graphs: print(gg)

+1
source

Source: https://habr.com/ru/post/958186/


All Articles