我想知道是否可以在服务器端渲染一个包含输入和输出的框!?
(仅供参考,我正在服务器端生成该框,因为该框的标题和状态根据我的应用程序中的其他选择而改变)
干杯, 卢克
library(shiny)
library(shinydashboard)
shinyApp(
ui = dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
uiOutput("box1")
)
),
server = function(input, output, session) {
data2plot <-reactive({rnorm(n = input$samplesize, mean = 100, sd = 30)})
# Rendered box with input AND output (gives error)
output$box1 <- renderUI({
box(
textInput(inputId = "samplesize", label = "Sample size:", value = 500),
hist(data2plot())
) })
}
)