【发布时间】:2016-06-22 22:55:18
【问题描述】:
我正在尝试运行一个简单的 Shiny 应用程序,该应用程序需要几个文本输入来生成 SQL 语句。当我取消注释 textInput 控件时,我不断收到以下错误。
match.arg(position) 中的错误:'arg' 必须为 NULL 或字符向量
我正在运行的代码是: ui.R
library(shiny)
shinyUI(fluidPage(
# Application title
titlePanel("SQL Developer"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("topnrows",
"Number of rows to show:",
min = 1,
max = 100,
value = 50)
),
textInput("text1", label = "Text input", value = "Enter text..."),
# textInput("dbName",
# label="Enter the Database Name",
# value="Enter Database Name"),
# textInput("tableName",
# "Enter the Table Name"),
# Show a plot of the generated distribution
mainPanel(
h3( textOutput("sqlText"))
)
)
))
server.R 图书馆(闪亮)
shinyServer(function(input, output) {
output$sqlText <- renderPrint({
paste("select top ", input$topnrows, " * from trial.table",sep='')
})
})
注释 textInput() 行,我可以运行应用程序。我无法弄清楚我在 textInput 函数中缺少什么以显示错误。非常感谢任何帮助。
【问题讨论】: