I have simple application to calculate summary , the summary part works fine. how ever i want output the results back to the UI as html. I cant get it to work with renderUI and htmloutput. if i use rendertable and tableoutput i get a partial output with headers missing and html tables are not resolved. Any pointers?
library(qwraps2) #for the summary table
library(shiny)
library(dplyr)
ui <- fluidPage( tabsetPanel(
tabPanel("Summary",
# mainPanel(tableOutput('summarytab'))
mainPanel(htmlOutput('summarytab'))
)
)
)
server <- function(input, output){
output$summarytab <- renderUI({
our_summary1 <-
list("Miles per gallon" =
list("min" = ~ min(mpg),
"max" = ~ max(mpg),
"mean (sd)" = ~ qwraps2::mean_sd(mpg)),
"Cylinder" =
list("min" = ~ min(cyl),
"max" = ~ max(cyl),
"mean (sd)" = ~ qwraps2::mean_sd(cyl))
)
summary_table(filter(mtcars),our_summary1)
})
}
shinyApp(ui = ui, server = server)