Is it possible to create tabItems and subItems and fluidRow boxes with loops within R for RShiny?
For example, instead of doing all this:
tabItem(tabName = "table1",
textOutput("outputText1"),
div(style = 'overflow-x: scroll', DT :: dataTableOutput("table1"))
),
tabItem(tabName = "table2",
textOutput("outputText2"),
div(style = 'overflow-x: scroll', DT :: dataTableOutput("table2"))
),
tabItem(tabName = "table3",
textOutput("outputText3"),
div(stlye = 'overflow-x: scroll', DT :: dataTableOutput("table3"))
),
tabItem(tabName = "table4",
textOutput("outputText4"),
div(stlye = 'overflow-x: scroll', DT :: dataTableOutput("table4"))
),
tabItem(tabName = "table5",
textOutput("outputText5"),
div(stlye = 'overflow-x: scroll', DT :: dataTableOutput("table5"))
),
tabItem(tabName = "table6",
textOutput("outputText6"),
div(stlye = 'overflow-x: scroll', DT :: dataTableOutput("table6"))
),
tabItem(tabName = "table7",
textOutput("outputText7"),
div(stlye = 'overflow-x: scroll', DT :: dataTableOutput("table7"))
),
tabItem(tabName = "table8",
textOutput("outputText8"),
div(stlye = 'overflow-x: scroll', DT :: dataTableOutput("table8"))
),
I could just create loop to create tabItems?
extra background info: In university, when I was first learning R, my prof told me that using if and for statements can cause R to be very slow. So I try to avoid using loops as much as possible.