Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Shining(R)中复制导航栏示例时出现问题_R_Navbar_Shiny - Fatal编程技术网

在Shining(R)中复制导航栏示例时出现问题

在Shining(R)中复制导航栏示例时出现问题,r,navbar,shiny,R,Navbar,Shiny,我试图从Shining网站()复制Navbar示例,但做了一些小改动(请参见下面的代码)。但是,主面板中既不显示绘图,也不显示表格。面板是空的,没有显示错误消息。但是,当我在代码中引入helpText元素时,它会显示出来。在我的机器上运行RStudio或访问spark.RStudio.com时也是如此 你能指出哪里出了问题吗?谢谢 ui.R: shinyUI(navbarPage("test", tabPanel("START",

我试图从Shining网站()复制Navbar示例,但做了一些小改动(请参见下面的代码)。但是,主面板中既不显示绘图,也不显示表格。面板是空的,没有显示错误消息。但是,当我在代码中引入helpText元素时,它会显示出来。在我的机器上运行RStudio或访问spark.RStudio.com时也是如此

你能指出哪里出了问题吗?谢谢

ui.R:

shinyUI(navbarPage("test",
               tabPanel("START",
                        sidebarLayout(
                          sidebarPanel(
                            radioButtons("plotType", "Plot type",
                                         c("Scatter"="p", "Line"="l")
                            )
                          ),
                          mainPanel(
                            plotOutput("plot")
                          )
                        )
               ),
               tabPanel("Summary",
                        verbatimTextOutput("summary")
               ),
               navbarMenu("More",
                          tabPanel("Table",
                                   dataTableOutput("table")
                          ),
                          tabPanel("About",
                                   dataTableOutput("table")
                          )
               )
))
server.R

shinyServer(function(input, output, session) {
  output$plot <- renderPlot({
    plot(cars, type=input$plotType)
  })

  output$summary <- renderPrint({
    summary(cars)
  })

  output$table <- renderDataTable({
    cars
  }, options=list(iDisplayLength=10))
})
shinyServer(功能(输入、输出、会话){

output$plot id是唯一的。不能有具有相同id的元素。
dataTableOutput(“table”)
在复制id的示例中被调用了两次。非常感谢!它现在可以工作了。