[英]How can I display a local html file in Shiny UI dynamically?
An example.html gets created in a local directory by another script.另一个脚本在本地目录中创建了一个 example.html。 Until then, Shiny UI should show an empty screen, and when the example.html gets generated, it should be reflected in Shiny UI.
在那之前,Shiny UI 应该显示一个空屏幕,当 example.html 生成时,它应该反映在 Shiny UI 中。
The example.html is loaded into the Shiny UI, but it is not getting reflected. example.html 已加载到 Shiny UI 中,但未得到反映。
This is the code I've tried, at least for displaying the file这是我试过的代码,至少用于显示文件
Code:代码:
ui = shinyUI(fluidPage(titlePanel("Generated Report"),
mainPanel(htmlOutput("showfile"))
)
)
server = function(input, output, session){
output$showfile <- renderUI({
includeHTML("C://Users//DELL//Desktop//abc_files//www//report.html")
# HTML(readLines(file_to_show))
})
}
shinyApp(ui, server)
If you want to display the ...report.html file in your shiny app, the //
in your path-to-file are not correct.如果您想在闪亮的应用程序中显示 ...report.html 文件,则文件路径中的
//
不正确。
This script (with a single /
) will display the HTML file.此脚本(带有单个
/
)将显示 HTML 文件。
ui = shinyUI(fluidPage(titlePanel("Generated Report"),
mainPanel(htmlOutput("showfile"))
)
)
server = function(input, output, session){
output$showfile <- renderUI({
includeHTML("C:/Users/DELL/Desktop/abc_files/www/report.html")
# HTML(readLines(file_to_show))
})
}
shinyApp(ui, server)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.