Combine Shiny Apps Using Navbar Page

2,271 views
Skip to first unread message

Tal Levy

unread,
Nov 26, 2014, 2:10:26 PM11/26/14
to shiny-...@googlegroups.com
I have several shiny apps that I would like to combine into a single web page. I was curious whether it is possible to do this using the navbarPage, where each tab on the navbar would call the referenced shiny app.

My pseudo code would go something like:

shinyUI(navbarPage("Multiple Shiny Apps on One Web Page",
    tabPanel("shiny app 1", call(path to shiny app1) ),
    tabPanel("shiny app 2", call(path to shiny app2) ),
    tabPanel("shiny app 3", call(path to shiny app3) ),
)

Of course, I could always copy the code from shiny apps 1 - 3 into a single UI and server files, but I find it much cleaner and more manageable to keep my code broken out into separate files and components when possible.

Thanks,
Tal

Vincent

unread,
Nov 27, 2014, 5:46:26 AM11/27/14
to shiny-...@googlegroups.com
You can create one app that combines the components using navbarPage. Take a look at Joe Cheng's partials approach and notice the use of source()

Tal Levy

unread,
Nov 30, 2014, 4:29:07 PM11/30/14
to shiny-...@googlegroups.com
Thanks for the reply. This looks about half of the way there. Ideally I would like have each shiny app stand on its own, and then have a simple way of combining them into one Navbar page to make them all accessible from one web page. This may simply not be possible. 

Herman Sontrop

unread,
Dec 1, 2014, 6:45:05 PM12/1/14
to shiny-...@googlegroups.com
Another way is to use subApps. This works quite well. For instance I constructed a Dashboard app which uses two subApps, one for cleaning data an another to do some fancy filtering via a UI. The idea is to launch apps from within a main shiny app. After launch you get a URL, which you can feed back to your main app via an iFrame. You can launch and close as many of these apps as you like. (Shiny also has functions to kill off sub apps). You can even use environments to make the apps talk to each other. If you want I can produce an example (at the end of the week).

Vincent

unread,
Dec 2, 2014, 4:48:14 PM12/2/14
to shiny-...@googlegroups.com
The subApps approach sounds interesting. I would certainly like to see an example. The app you are describing also sound sounds interesting. Is it an open-source project? I have a few things on data cleaning but that is not an easy problem.

jebsel

unread,
Feb 9, 2015, 4:54:58 PM2/9/15
to shiny-...@googlegroups.com
I am interested to see an example of that...
Actually now working with the partials approach from Joe Cheng but we are also intrested to launch apps from within a main shiny app as is...

Op dinsdag 2 december 2014 00:45:05 UTC+1 schreef Herman Sontrop:
Reply all
Reply to author
Forward
0 new messages