【发布时间】:2021-02-23 09:36:33
【问题描述】:
此代码应生成一个弹出窗口,允许为闪亮的应用选择目录。
但是,当我运行代码时,按钮会出现,但在 R-studio 查看器和在网络浏览器中运行时均无响应。
代码对您有用吗?有什么我做的不对吗?
library(shiny)
library(shinyFiles)
ui <- fluidPage(
shinyDirButton('folder', 'Select a folder', 'Please select a folder', FALSE)
)
server <- function(input, output){
volumes = getVolumes() # this makes the directory at the base of your computer.
observe({
shinyDirChoose(input, 'folder', roots=volumes, filetypes=c('', 'txt'))
print(input$folder)
})
}
shinyApp(ui=ui, server=server)
提前谢谢你
【问题讨论】: