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