【发布时间】:2018-10-22 04:32:29
【问题描述】:
我对 Rshiny 保持沉默。我想捕获用户输入的信息(变量)并将它们传递给 python 脚本,我将在 R 本身中调用它。但最初我需要服务器代码方面的帮助,我在反应代码部分没有做正确的事情。
到目前为止我的代码是:
library(shiny)
ui <- fluidPage(
headerPanel(
titlePanel("RADP CR Prediction Tool"),
br(),
tags$head(tags$script(src = "message-handler.js")),
textInput('Region', label = 'Enter the region'),
textInput('Regulatory', label = 'Enter the regulatory status'),
textInput('Description', label = 'Enter the description for the CR'),
br(),
br(),
actionButton("goButton", "Go!"),
mainPanel(
# Output: Formatted text for caption ----
h3(textOutput("caption", container = span)),
# Output: Verbatim text for data summary ----
verbatimTextOutput("summary"),
# Output: HTML table with requested number of observations ----
tableOutput("view")
)
)
server <- function(input, output, session) {
region_input=reactive(input$Region)
regulatory_input <- reactive(input$Regulatory)
description_input <-reactive(input$Description)
observeEvent(input$do, {
session$sendCustomMessage(type = 'testmessage',
message = 'Thank you for clicking')
})
}
shinyApp(ui, server)
当我运行代码时,它给了我错误:意外符号在: ") 服务器”
我需要使用regulatory_input、description_input和region_input作为R变量,这样我可以做进一步的分析。
【问题讨论】: