This may be very simple, but I cannot find the right syntax despite searching through postings:
I want to create a hyperlink on my shiny web page which when clicked should open a file from the same location where the application is.
Here is a sample code :
library(shiny);
shinyApp( ui = fluidPage(a("test_hyperlink",href="./readme.txt")),
server = function(input, output) { } )
readme.txt is in the same location as this application .
I tried the following with no success :
file://readme.txt # relative path
file:///srv/shiny-server/myApp/readme.txt # absolute path
href://./readme.txt # relative path
href:///srv/shiny-server/myApp/readme.txt # absolute path
Any help?
create a folder called 'www' inside your shiny app directory 'appFolder'.
Put the file 'readme.txt' in the www folder.
File path is href="readme.txt"
You have to use 'runApp(appFolder)' command to start your shiny app. It then can access all local files inside the www folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With