RStudio developers are really hard working. Somehow in their spare time they have worked on their shiny
package for making interactive web pages. This gist compares writing a shiny web app to writing a similar app using gWidgetsWWW2.rapache
. We only look here at the code, not the deployment. In general, deploying a shiny app widely seems best suited for RStudio's service, currently in beta, though clearly a local shiny app is also quite useful. Deploying an app under gWidgetsWWW2.rapache
is fairly easy -- though not very widely tested.
We follow the tkdensity.R
GUI from the tcltk
package for comparison. This is a standard example with some controls and a resulting graphic. It is right up shiny's alley. We compare to the manipulate
commands which mimic RStudio's manipulate
pacakge and to straight gWidgets
s:
There are 4 files:
- a file showing how to do this with manipulate (this is an example from the
gWidgetsWWW2.rapache
package) - a file showing gWidgetsWWW2.rapache style (both have a workaround for the need to have integer values for a slider)
- two files for shiny (both quick modifications of one of the examples)
Clearly the manipulate code is easiest, but that is the most limited framework. I have to say shiny comes in second and not a distant one. It also looks better, as the bootstrap CSS seems more modern to me than that for extjs. To run the shiny app here you have only to execute: shiny:::runGist("4009017")
. The manipulate example is at http://www.math.csi.cuny.edu/gw/ex-manipulate.R (though this runs on a private server which is often not online). As for gWidgetsWWW2.rapache
this is maybe a more flexible framework than shiny. One could argue this point, but certainly it has more flexibility for a non-web programmer.