This is another try for my other post Shiny hyperlink relative path to a file :
In brief, I want to create a hyperlink on my shiny web page which when clicked should open a new HTML page with the content created in server.R file.
Here is a sample code that I tried but didn't work ( NOT FOUND error in chrome ):
library(shiny);
shinyApp( ui = fluidPage(a("readme",href=htmlOutput("readme"),target="_blank")),
server = function(input, output) {
output$readme<-renderUI({
htmlcontent <- tags$html( tags$head( tags$title('Content of README.txt')),
tags$body(p(system("cat README.txt",intern=TRUE)))
)
return(htmlcontent)
})
})
README.txt is in the same location as this application on the linux server.
Any help?