Update plot within observer loop in shiny application

后端 未结 2 1456
孤城傲影
孤城傲影 2020-12-06 12:08

I have written a simulation in R that I want to visualize with shiny now. I have put the main part of the simulation into an observe block in order to be evaluated.

2条回答
  •  孤城傲影
    2020-12-06 12:33

    Since you have a Sys.sleep() call in your code, I'm assuming you only want to run through one iteration per second. If that's the case, you could set a reactiveTimer that will evaluate code every second. Inside that timer, you'd run the code for the current iteration then bump up the dummy$iter variable.

提交回复
热议问题