I develop a shiny app with a manager interface. This interface allows a statistician to import data and create plots. I would like to save the html element to display on the user page by renderUI({HTML(content)})
. The same question is ask on rstudio community website : https://community.rstudio.com/t/how-can-i-save-r-shiny-html-output-to-an-external-file/89415
For example on the example below how to save the content of htmlOutput('content')
library(shiny)
library(datasets)
library(shinyjqui)
# Global variables
n <- 200
# Define the UI
ui <- fluidPage(
numericInput('n', 'Number of obs', n),
selectInput("region", "Region:",
choices=colnames(WorldPhones)),
br(),br(),
htmlOutput('content')
)
# Define the server code
server <- function(input, output) {
output$content <- renderUI({
fluidRow(
jqui_resizable(column(6, plotOutput('plot1'))),
jqui_resizable(column(6, plotOutput('plot2')))
)
})
output$plot1 <- renderPlot({
hist(runif(input$n))
})
output$plot2 <- renderPlot({
barplot(WorldPhones[,input$region]*1000,
main=input$region,
ylab="Number of Telephones",
xlab="Year")
})
}
shinyApp(ui = ui, server = server)
Thank you for your reply