At the risk of getting hit with a mods "too broad a question" hammer, I want to ask given the plethora of interactive R Shiny
tools and packages emerging, when do you use which one?
Shiny - to me only downside your project needs to run from shiny server but seems the best choice.
shinydashboard - Shiny but has nice Value boxes for callouts.
flexdashboard - write it up in Rmd. What does that gain you that straight Shiny does not? Perhaps, useful to email to a client provided you are happy to pass over data? I have been playing around with flexdashboard
but its inability to work with datatable (library(DT)) makes me feel like it needs a few more iterations.
Looking at other answers, I am not alone in asking this question.
The creators are providing lots of galleries out there to showcase their packages/approach, but how do you know which path to go on?
What are the clear advantages of using one over the other?
flexdashboard is just enhanced RMarkdown, using simple convention for UI arrangement, htmlwidgets etc. You can use Shiny in it but it's limited. To use Shiny you will need to write more code for UI and behavior, learn more things related to html, css, especially reactive which need some time to grasp.
shinydashboard: Create Dashboards with 'Shiny' Create dashboards with 'Shiny'. This package provides a theme on top of 'Shiny', making it easy to create attractive dashboards.
There's one nuance that needs to be made. Interactivity does not necessarily require a server behind it running code. Interactivity can be provided using embedded JavaScript, which would execute at the client-side (like plotly, highcharts, leaflet etc). So if we don't use the word "interactivity", but describe the interactivity explicitly, then your options become:
So basically, if whatever interactivity is required can be offered by an existing package (that uses htmlwidgets), then you can just use flexdashboard and you don't need to deploy it to any Shiny server. Otherwise, you do need to deploy to a Shiny server and you should use either Shiny, or shinydashboard.
I like to put shiny modules inside a flexdashboard. As long as you put runtime: shiny
in your YAML
header section, using shiny modules should be relatively straightforward. By relative, I mean, take a day and read over all the examples from RStudio, then try to do the same with your code. Once you're over the learning curve, modules in flexdashboards make future development much more streamlined, mentally easy, and in my experience, afford me the opportunity to really focus on the underlying data-based questions I've been asked to address. I think flexdashboards + shiny modules
is the best of both worlds: flexdash to break up some of the layout items, easily add or remove a section of code, isolate various aspects of your application code in a more visually distinct layout (the shading of 'chunks' in an RMD file, etc.), while still allowing you to get into more complex, quintessentially shiny
things like setting up observers, proxies, or custom layouts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With