I want to build an app that will start plotting after a press of a button and it will keep plotting (with some time in between graphs) until the for cycle has ended. The function that calculates what to plot is rather elaborate so I will provide a minimal working example from base R, that I want to run in shiny. Again I'm not sure how to approach this, so I can't provide the code in terms of server.r and ui.r.
for (i in 1:10){
A <- matrix(nrow=5,ncol =5,sample(3,size =25,replace=T))
Sys.sleep(0.3)
image(A,xaxt='n', ann=FALSE,yaxt='n',bty="n",asp=1)
}
How should I approach this?
I think I will be able to make the progress bar work myself, but the continuous plotting stopped me from doing anything.