【发布时间】:2015-07-02 01:50:35
【问题描述】:
我知道common mistakes 关于此主题的讨论。我尝试了添加或删除 ID、标签和逗号的各种组合,但我似乎无法弄清楚我的代码有什么问题。
现在我的应用程序没有做任何实质性的事情,我只是想设置它。现在,预期的行为是它运行,允许用户输入任何文本,点击提交按钮,并返回“hello world!”
server.R 代码:
library(shiny)
shinyServer(
function(input, output) {
output$results <- renderText({
"hello world!"
})
}
)
ui.R 代码:
library(shiny)
shinyUI(fluidPage(
titlePanel("Title goes here."),
sidebarLayout(
sidebarPanel(
helpText("Enter a few words, then select 'submit'!"),
textInput("input"),
submitButton("submit", label = "submit"),
),
mainPanel(
textOutput("results")
)
)
))
实际行为在浏览器上返回此错误:
ERROR: argument "label" is missing, with no default
R 控制台中的这个错误:
> shiny::runApp()
Listening on http://127.0.0.1:4635 Error in label %AND% tags$label(label, `for` = inputId) : argument "label" is missing, with no default Error in label %AND% tags$label(label, `for` = inputId) : argument "label" is missing, with no default
对于调试闪亮应用程序的任何一般性建议将不胜感激!
【问题讨论】: