When I put a download button inside a navBarPage, clicking on the button opens a copy of the entire shiny app in a new tab, instead of starting a download.
Any ideas why this might be happening or how to get around it?
example code is below:
ui.R:
shinyUI(navbarPage("my page", id="nav",
tabPanel("my tab",
downloadLink('downloadData', 'Download')
)
))
server.R:
shinyServer(function(input, output) {
output$downloadData <- downloadHandler(
filename = "cars.csv",
content = function(file) {
write.table(cars, file)
}
)
})