I am guessing you just want a button to show up? You can add class = 'btn'
to your anchor.
Here is an example showing with class = 'btn'
and without.
library(shiny)
runApp(list(
ui = bootstrapPage(
numericInput('n', 'Number of obs', 100),
plotOutput('plot'),
tags$a(href = 'foo.pdf', class = "btn", icon("download"), 'Download file.'),
tags$a('Download file2.', href = 'foo2.pdf'),
downloadButton('downloadData', 'Download')
),
server = function(input, output) {
output$plot <- renderPlot({ hist(runif(input$n)) })
output$downloadData <- downloadHandler(
filename = function() {
paste('data-', Sys.Date(), '.csv', sep='')
},
content = function(con) {
write.csv(data, con)
}
)
}
))
To add an icon like the shiny
function downloadHandler
has refer to the fontawesome library. For example
here is the icon the shiny function uses http://fontawesome.io/icon/download/. Shiny has a wrapper function icon
to include these icons.