【发布时间】:2018-08-13 14:08:54
【问题描述】:
我有一个闪亮的应用程序,它接受文本输入并将其显示在主面板上(我使用this 答案构建它):
ui.r:
library(shiny)
shinyUI(fluidPage(
titlePanel("This is a test"),
sidebarLayout(
sidebarPanel(
textInput("text1", "Enter the text", ""),
actionButton("goButton", "Go")
),
mainPanel(
h3(textOutput("text1", container = span))
)
)
)
)
server.r:
shinyServer(function(input, output) {
cap <- eventReactive(input$goButton, {
input$text1
})
output$text1 <- renderText({
cap()
})
})
在我决定添加一个 Tabset 面板并在其中一个选项卡上显示输入之前,它工作得很好。我将 ui.r 中的 mainPanel() 修改为:
mainPanel(
tabsetPanel(type = "tabs",
tabPanel("t1"),
tabPanel("t2",
tabPanel("t3"), h3(textOutput("text1", container = span)),
)
)
进行此更改后,启动应用时出现错误:
ERROR: cannot coerce type 'closure' to vector of type 'character'
我有什么遗漏吗?
【问题讨论】: