I have several shiny apps, and now I want to create a dashboard for these apps. I don't want to change the original apps. Just want to create another ui.R and server.R. And integrate the other apps into it. Like the following structure.
#ui.R
ui <- dashboardPage(
dashboardHeader(title = "App User Analyse"),
dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
menuItem("Widgets", tabName = "widgets", icon = icon("th"))
)
),
dashboardBody(
tabItems(
# First tab content
tabItem(tabName = "Dashboard",
***app1***
),
# Second tab content
tabItem(tabName = "widgets",
***app2***
)
)
)
)
I'm not sure if there is a way to achieve this. If yes, could any one give me a small example?
My first instinct is that you can't simply copy all the apps code into one place and expect it to work, you'll have to do a little bit of work to integrate them all together. For example, if two of your apps have an input field with id "foo", then you can't have both of them unchanged in one shinydashboard app because you cannot have multiple elements with the same id. This is just a very simple example of why you can't simply concatenate all the code together.