我試圖從模塊獲取輸入到應用服務器。Shiny:從模塊獲取輸入
這裏是我想要的一個例子中,app.R:
library(shiny)
source("test.R")
ui <- fluidPage(
tabPanel("tt", testUI("t"))
)
server <- function(input, output) {
ret <- callModule(test, "testm")
print(ret)
}
shinyApp(ui = ui, server = server)
測試模塊:
testUI <- function(id) {
ns <- NS(id)
tabPanel(NULL,
textInput(ns("textInput1"), label = h5(""), value = "")
)}
test <- function(input, output, session, data) {
reactive({input$textInput1})
}
我想從應用程序的服務器功能打印textInput1的內容.R並觀察它。
坦克您的回覆,現在的作品! – Grundoc