1

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

Community
  • 1
  • 1
CharlotteS.
  • 355
  • 1
  • 12
  • 1
    `choose.dir` is for interactive use only. There is some discussion related to your problem here https://groups.google.com/forum/#!topic/shiny-discuss/2WfMdPqmAlA – jdharrison May 08 '14 at 21:15

1 Answers1

3

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

CharlotteS.
  • 355
  • 1
  • 12