Show HTML file in Shiny app

Is it possible to display an html file in a Shiny application (on the main panel)? This HTML is generated by SAS code, but I want to display it in a Shiny application. This is not a small image. This is the tabular output in the HTML file.

The html file contains tabele, as shown below:

enter image description here

Any help would be greatly appreciated.

Thanks! Tinku

@MrFlick - Thanks for your email address. fluidPage does not work. It gives an error message:

ERROR: could not find function "fluidPage" 

titlePanel also does not work.

Note. When I used pageWithSidebar set in fluidPage and headerPanel instead of titlePanel then it works fine.

+8
r shiny
source share
1 answer

If you want to include HTML content from another file in the layout, just use the includeHTML() function. for example

 shinyUI(fluidPage( titlePanel("Included Content"), mainPanel( includeHTML("include.html") ) )) 

should be minimally sufficient for how the contents of "include.html" on a particular page. If you need to make it more dynamic, you can use

 # ----- ui.R ----- shinyUI(fluidPage( titlePanel("Uploading Files"), mainPanel( htmlOutput("inc") ) )) # ----- server.R ----- shinyServer(function(input, output) { getPage<-function() { return(includeHTML("include.html")) } output$inc<-renderUI({getPage()}) }) 

And you can use any logic you want to specify the name of the file you want to load.

+14
source share

All Articles