reactive tabPanel in a navbarMenu in Shiny

我是研究僧i 提交于 2020-01-06 02:48:07

问题


I am a beginner in this forum. I have a question on R shiny. I looked at some discussions about it in this forum but answers (R Shiny - add tabPanel to tabsetPanel dynamically (with the use of renderUI)) don't fit exactly what i am looking for.

I try to add some tabPalnels in navbarMenu with interaction: example I choose a directory and I list how many files are in and what are their names. then I would like to make tabPanel in navbarMenu which have the name of the files in the directory

ex :if dir = c:/charlotte/RY list.files(dir) = c(fichier1.csv, fichier2.csv)

I would like that the names of 2 tabpanels from the navbarMenu are called fichier1.csv and fichier2.csv. I try it but without results. I give you my code :

shinyUI(navbarPage("raster analysis",
               tabPanel("Analysis parameters",
                        actionButton("goButton","load session to analyze"),
                        textOutput("session")
               ),
               navbarMenu("NISTs",
                            tabPanel("Set up"

                            ),
                            tabPanel("About"
                            )

               ),
               navbarMenu("Samples",
                          tabPanel("Set up"
                          ),
                          tabPanel("About"
                          )
               ))


shinyServer(function(input, output) {


observe({    
if(input$goButton > 0){    
  output$session = renderUI({
    list.files(choose.dir(),pattern="\\.csv$")
  }) } })})

Do you have an idea on this topic ? Is it possible ? Thank you very much !! C


回答1:


After desperately looking for an answer, I wrote to Joe CHen, who made the example of the navbarMenu (http://shiny.rstudio.com/gallery/navbar-example.html), and I asked him if it was possible to do what I explain in my message. He told me that it is not possible at this moment (05/2014). Stop trying !! It is impossible :) See U,

Charlotte



来源:https://stackoverflow.com/questions/23544100/reactive-tabpanel-in-a-navbarmenu-in-shiny

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!