The R Shiny website has a great example of how to update the labels and values of a variety of input types based on user input. However, I couldn\'t find anything for butto
You can dynamically create the Button like so, updating the labels at the same time:
library(shiny)
ui =(pageWithSidebar(
headerPanel("Test Shiny App"),
sidebarPanel(
textInput("sample_text", "test", value = "0"),
#display dynamic UI
uiOutput("my_button")),
mainPanel()
))
server = function(input, output, session){
#make dynamic button
output$my_button <- renderUI({
actionButton("action", label = input$sample_text)
})
}
runApp(list(ui = ui, server = server))