In ui.R
, I put:
uiOutput(\"singlefactor\")
In server.R
, I have:
output$singlefactor <- rende
The value will be available like any other input, for example
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])})
})
))
You created a UI element with the name "sfactor" so you can get the value with input$sfactor