如何在ui.R中获取uioutput中的值并将其发送回server.R?

如何在ui.R中获取uioutput中的值并将其发送回server.R?,r,shiny,R,Shiny,在ui.R中,我将: uiOutput("singlefactor") 在server.R中,我有: output$singlefactor <- renderUI({ selectInput("sfactor", "Feature selection:", names(datatable())) }) output$singlefactor例如,该值将与任何其他输入一样可用 library(shiny) runApp(list(ui=shinyUI(fluidPag

ui.R
中,我将:

uiOutput("singlefactor")
server.R
中,我有:

  output$singlefactor <- renderUI({
    selectInput("sfactor", "Feature selection:", names(datatable()))
  })

output$singlefactor例如,该值将与任何其他输入一样可用

library(shiny)

runApp(list(ui=shinyUI(fluidPage(
  sidebarLayout(
    sidebarPanel(
      uiOutput("singlefactor")
    ),
    mainPanel(
      plotOutput("distPlot")

    )
  )
))
,
server=shinyServer(function(input, output) {
     output$singlefactor <- renderUI({
    selectInput("sfactor", "Feature selection:", names(mtcars))
  })
  output$distPlot <- renderPlot({plot(mtcars[,input$sfactor])})

})
))
库(闪亮)
runApp(列表)(ui=shinyUI(fluidPage(
侧边栏布局(
侧栏面板(
输出(“单因素”)
),
主面板(
plotOutput(“distPlot”)
)
)
))
,
服务器=shinyServer(功能(输入、输出){

输出$singlefactor只需创建一个变量来侦听
input$sfactor
。类似于
my\u var的东西是的,它完全可以工作!非常感谢。我对shiny完全是新手。所以可能有很多问题对我来说很困难。