我一直在制作一个闪亮的应用程序,它意味着为多个不同的人使用/编辑同一个文件 .

我们的想法是,当您第一次打开应用程序时,它会提示您选择文件,并保存文件的位置,这样您就不必在每次打开程序时都选择它 .

我似乎找不到这样做的方法,只保存对文件的编辑 . 有没有办法,或者你只需要每次都选择文件?

编辑:这里有一些简单的代码,可以让您了解我一直在使用的内容

library(shiny)
setwd("~/myfiles")

ui <- fluidPage(
  fileInput("user_file", "Please enter a file"),
  textOutput("txt_param")
)

server <- function(input, output, session) {
  file_path <- input$user_file$datapath

  output$txt_param <- renderText(as.character(input$user_file$datapath))

  ### Store the file's path in a csv to access later ###
  as.data.frame(file_path)
  write.csv(file_path, "user_file_path.csv")
}

shinyApp(ui, server)