Using shinyFiles in RMarkdown

Hello, all.

I'm trying to use shinyFiles in an RMarkdown file to create a button that allows the user to choose a folder from their computer. This is my code so far:

shinyServer(function(input, output) {
  shinyDirChoose(input, 'data', roots=c(wd='.'), filetypes=c('', 'txt'))

inputPanel(shinyDirButton('data', label = "Select Data Folder", title = "Upload"))

The button renders fine when I hit the Run Document button. Unfortunately, when pressed, it won't actually open the finder dialogue to let the user choose a folder. Nothing happens.

Any help would be much appreciated! Thanks!

Did you add runtime: shiny to the document’s YAML header?

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

Yes, I did. Other shiny components (that don’t require a server side function) are working just fine.

maybe it simply doesnt work in this context... you could consider raising it as an issue on the shinyFiles github