I am not sure what is the difference between function and reactive. Any comments?
Yes, that's what I did in my previous post
Yes, that's what I did in my previous postNo, you did print(p) at the end of Plot1() instead of return(p).
--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
In general, plot rendering is not something you want to do in a reactive expression; the reason is because reactive expressions cache their calculated values and only actually re-execute when one of the reactive inputs they depend on change. So if you are calling the same reactive that does a plot from two places in your code, then only one of those will have the behavior you want and the other will not get a plot rendered.
The changes that Stéphane recommended ensure that the "side effect free" calculations happen inside the reactive, while the operations that have side effects (printing a ggplot object) only occurs in the output and content functions where they always belong.