Fail to save the file to the server side of shiny app

做~自己de王妃 提交于 2020-03-05 03:23:52

问题


I am trying to save a file on the server side of where I am running the shiny app but for some reason I don't see the path when I try to save it.

Here is the code that I have it currently in the shiny app

library(shinyFiles)

shinySaveButton(id = 'download.scores', label =  'Save scores', title = "Save file as...", filetype = "csv")

observe({
    volumes <- c("wd"="/home/rstudio/data")
    shinyFileSave(input, "download.scores", roots=volumes, session=session)
    fileinfo <- parseSavePath(volumes, input$download.scores)
    if (nrow(fileinfo) > 0) {
      write.csv(score.show$scores, as.character(fileinfo$datapath), row.names = F)
    }
  })

When I try to save it, I see the blank path in the dialog box. What am I doing wrong here?

来源:https://stackoverflow.com/questions/53731269/fail-to-save-the-file-to-the-server-side-of-shiny-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!