选择有光泽的

Choose dir shiny

本文关键字:有光泽 选择      更新时间:2023-09-26

我有一个简单的闪亮的应用程序,它可以在我的本地PC上运行,并且可供我的内部网中的用户使用。我尝试添加按钮来选择文件夹。

试:

用户界面

library(shiny)
shinyUI(fluidPage(
                            actionButton("goButton","Choose folder"),
                            textOutput("session"))
)

服务器

library(shiny)
shinyServer(function(input, output, session) {
  observe({
    if(input$goButton > 0){
      output$session <- renderText(function(){
        list.files(choose.dir())})
    }

  })
})

它在我的PC上运行正常,但是当有人在Intranet(其他PC)窗口中使用它来选择文件夹时,在我的PC中打开。

有没有办法在客户端PC上打开选择文件夹?

我可以找到它shinyFiles库的最佳选择(来自RU_SO的答案)

此软件包允许浏览服务器文件系统。

shinyFilesExample()

但对我来说,它的工作有点慢,我计划使用简单的 dunamic selectInputlist.dirs(path = "some/path")