yourdataframe <- data.frame(column=1:4)
ui <- shiny::fluidPage(
shiny::uiOutput("yourinput")
)
server <- function(input, output) {
output$yourinput <- renderUI({
shiny::selectInput(
"Category_Name",
"Category Name",
unique(yourdataframe$column ))
})
}
shiny::shinyApp(ui,server)
It was just a missing parenthesis in the unique line.
Another option:
You can create an empty selectInput and update it afterwards.
Lastly, another option is if the data is static (i.e. it is not gonna change during the app life), you can load it as global and use it inside the ui.
yourdataframe <- data.frame(column=1:4)
ui <- shiny::fluidPage(
shiny::selectizeInput("Category_Name", "Category Name", unique(yourdataframe$column )),
shiny::textOutput("selected")
)
server <- function(input, output) {
output$selected <- shiny::renderText(as.character(input$Category_Name))
}
shiny::shinyApp(ui,server)