R Shiny保存下一个会话的文件路径

时间:2018-07-11 17:43:23

标签: r shiny shinydashboard shinyjs

我一直在制作一个闪亮的应用程序,它的目的是为多个不同的人使用/编辑同一文件。

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

我似乎找不到办法,只能将编辑保存到文件中。有没有办法,还是每次都只需要选择文件?

编辑:这是一些简单的代码,可让您了解我一直在使用的东西

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)

0 个答案:

没有答案
相关问题