【发布时间】:2019-10-18 08:40:02
【问题描述】:
我有 2 个条件让数组以闪亮的方式显示。我尝试在 R 中使用以下代码闪亮但不是输出
library(shiny)
ui <- fluidPage(
sidebarLayout(
sidebarPanel(selectInput("x","Value of x",choices =
c("Array1","Array2"))),
mainPanel(h6("Here it is"),
textOutput("message")
)
)
)
server <- function(input, output, session) {
output$message <- renderUI(
{
if(input$x == "Array1")
{
renderTable(array(1:20, dim=c(4,5)))
} else
{
if(input$x == "Array2")
{
renderTable(array(1:25, dim=c(5,5)))
}
}
}
)
}
shinyApp(ui, server)
代码中是否存在问题。请指教
【问题讨论】: