I am creating my first Shiny Application in R. I am using shiny to display bivariate results from a survey I conducted. From a pair of input boxes users can choose variables from the survey, and various statistics are generated (tables, plots, etc.) allowing them to explore certain attributes of the survey data.
I want to include a link to the actual PDF survey. Right now I have written code so that the PDF survey can be linked to, by clicking on the text "Click here to download survey" which appears as helpText
, embedded in a wellPanel
, within the pageWithSidebar
. I used the following commands (in the ui.R file):
wellPanel(
helpText( a("Click Here to Download Survey", href="http://www.dfcm.utoronto.ca/Assets/DFCM2+Digital+Assets/Family+and+Community+Medicine/DFCM+Digital+Assets/Faculty+$!26+Staff/DFCM+Faculty+Work+$!26+Leadership+Survey+Poster.pdf")
)
)
Is there a way to automatically open this file in a new tab (of IE, Firefox, etc.)? Currently, the functionality is to open the link in the same tab as the shiny app. So you have to use the forward and backwards buttons to go from app to survey and back again.
Right now, I am right clicking the link and selecting "Open in a New Tab". Is there a way to embed this functionality into the back end code so it becomes the default.
Disclaimer: I have no real experience in html or java. I am an avid user of R. If a solution is possible, can you please try to explain where I embed the code changes in the ui.R or server.R files respectively.
question from:
https://stackoverflow.com/questions/17861102/add-link-to-r-shiny-application-so-link-opens-in-a-new-browser-tab 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…