Get renderUI html from shiny app in to params for R markdown output

I am looking to generate a report from a shiny app. I have some text that I want to pass to the params argument to go in to the report.

For example in the code below, I want the output of output$text passed in to a params argument. Any idea on how to do this (with formatting)? I have tried a few things, but can't get anything to work.

library(shiny)

ui <-  pageWithSidebar(
    headerPanel("Example"),
    sidebarPanel(
        sliderInput("number", 
                    label = "Select a number",
                    min = 1,
                    max = 4,
                    step = 1,
                    value = 2)),
    mainPanel(
        htmlOutput("text")
    ))
server <-  function(input, output) {
        output$text <- renderUI({
            HTML(paste("Number","<b>", input$number,"</b>", "selected" ))
        })
    }

shinyApp(ui = ui, server = server)

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.