2017-11-25 12 views
0

これは私のCoursa Data Science Specializationの一部としての初めてのShiny Appです。私はドキュメンテーション用のタブを作成しようとしていますが、Mainタブの出力はMainAppタブとDocumentationの両方に表示されます。Shiny Appは複数のタブで出力を表示します

"ドキュメント"タブに出力しません。

助けが必要ですか?ありがとう!

これはui.Rコードです:

shinyUI(
    pageWithSidebar(
    headerPanel (" Six Sigma Control Charts"), 



     tabsetPanel(


     tabPanel("MainApp", 
       sidebarPanel(
        h5 ("Control Charts are six sigma tools that track process statistics over time to detect the presence of special causes of variation. There are different types of charts according to the data type that you are analysing."), 

        selectInput("DataType", "Please select Data Type", 
           choices = c("Continuous", "Attribute")), 
        conditionalPanel(condition = "input.DataType == 'Continuous'", 
            selectInput("Groups", "Data collected in groups?", 
               choices = c("Yes", "No"))), 
        conditionalPanel(condition = "input.DataType == 'Attribute'", 
            selectInput("Counting", "What are you counting?", 
               choices = c("Defective items", "Defects per unit"))), 


        conditionalPanel(condition = "input.Groups == 'Yes' & input.DataType == 'Continuous' ", 
            textInput ("SubgroupSize", "Enter sub group size",1) ) 


       )), 

     tabPanel("Documentation", 

       h5 ("This Shiny App helps you to familiarise with Six Sigma Control Charts."), 
       h5 ("The different types of graphs are produced according to the type of data that you want to analyse"), 
       h5 ("Make a choice according to the data type to explore the various Six Sigma graphs") 
     ) 





    ), 



    mainPanel (

      plotOutput ("ControlChart"), 
      textOutput("Explanation"), 
      br(100), 
      br() 


    ) 


) 

) 

答えて

0

それはpageWithSidebar機能では不可能です。この関数は、とにかく推奨されなくなりました。 navbarPagefluidPageを包むようにしてください:

# Define UI 
ui <- navbarPage("App Title", 
       tabPanel("Plot", 
          fluidPage(
          sidebarLayout(

           # Sidebar with a slider input 
           sidebarPanel(
           sliderInput("obs", 
              "Number of observations:", 
              min = 0, 
              max = 1000, 
              value = 500) 
          ), 

           # Show a plot of the generated distribution 
           mainPanel(
           plotOutput("distPlot") 
          ) 
          ) 
         ) 

       ), 
       tabPanel("Summary", 
          tags$br("Some text")) 
) 

# Server logic 
server <- function(input, output) { 
    output$distPlot <- renderPlot({ 
    hist(rnorm(input$obs)) 
    }) 
} 

# Complete app with UI and server components 
shinyApp(ui, server) 
+0

はどうもありがとうございました!私は今私の課題を完了することができます。 –

関連する問題