Is renderPlot in server.R paired with plotOuput in ui.R slow? It seems like it is because I have tried two plotting methods. The first involved using rCharts high charts library. My plotting function using high charts rendered each plot in about 0.007 to 0.01 seconds, whereas my plotting function using lattice rendered each plot in about 0.003 to 0.004 seconds, faster than my high charts plotting function as expected. However, when I use lattice in shiny, I use renderPlot and plotOutput (the standard way of displaying plots in shiny), and it renders more slowly than my high charts version which involves renderChart2 and showOutput as described here:
rCharts with Highcharts as shiny application
I can tell it renders more slowly because I am using making an animation, with a new plot rendering per tick of the animation. In other words I have a slider like this:
sliderInput("animation",
"Animation",
min = 1,
max = 20000,
value = 1,
step = 1,
animate = animationOptions(interval = 30,
playButton = icon('play', "fa-3x"),
pauseButton = icon('pause', "fa-3x")))
Thus, the ticks are occuring once every 30 milliseconds, and given that the plot renders in 4 milliseconds, I was surprised when my plots still lagged in between ticks, whereas the slower plotting function with rCharts high charts has no lag whatsoever. Is there a solution to this? If more information is needed, I will happily edit this post to include it, but I am pretty sure that it has to do with the renderPlot paired with plotOutput (used for the plotting function with lattice) compared to renderChart2 paired with showOutput (used for the plotting function with rCharts high charts) because those are the only two things I changed in my shiny app besides of course the plotting functions. I also microbenchmarked and the mean, median, min, and max were all faster for the lattice plotting function compared to the high charts rCharts plotting function. Any help would be greatly appreciated! Thanks!