【问题标题】:problems with dir.create and shinyapps.iodir.create 和 shinyapps.io 的问题
【发布时间】:2019-11-15 23:13:35
【问题描述】:

我正在尝试让应用程序在 shinyapps.io 上运行。 第一步是加载 rds 文件以进行 Dropbox 访问。 该应用程序应该在服务器上下载保管箱的一个文件夹。

我想在应用的“静态”目录中创建一个目录。

我试过了

dir.create (static/...)
dir.create (./static/...)

两者在本地都可以正常工作,但似乎 dir.create () 在 shinyapps 服务器上不起作用。 https://colomb.shinyapps.io/resultsgallery_software/ https://github.com/smartfigures-dar/SmartFig_Rbased_prototype/tree/dropbox_integration

请注意,它似乎对第 2 个实例起作用,然后不再起作用:

本地:

for (j in folders$path_display){
print(j)
foldercreated <-dir.create(paste0("./static",j))
}
[1] "/SFB-resultgallery"
[1] "/SFB-resultgallery/Figures"
[1] "/sfb-resultgallery/Figures/atg6-9_KD_in_brain"
[1] "/sfb-resultgallery/Figures/keep_it_short,_no_more_than1"
[1] "/sfb-resultgallery/Figures/2e"
[1] "/sfb-resultgallery/Figures/keep_it_short,_no_more_than"e

shinyapps.io 日志消息:

    2019-07-05T09:42:45.679221+00:00 shinyapps[1012452]: [1] "/SFB-resultgallery"
2019-07-05T09:42:45.679636+00:00 shinyapps[1012452]: [1] "/SFB-resultgallery/Figures"
2019-07-05T09:42:45.679740+00:00 shinyapps[1012452]: [1] "/sfb-resultgallery/Figures/atg6-9_KD_in_brain"
2019-07-05T09:42:45.679936+00:00 shinyapps[1012452]: Warnung in dir.create(paste0("./static", j))
2019-07-05T09:42:45.679938+00:00 shinyapps[1012452]:   kann Verzeichnis './static/sfb-resultgallery/Figures/atg6-9_KD_in_brain' nicht erzeugen. Grund 'No such file or directory'

【问题讨论】:

    标签: r shiny


    【解决方案1】:

    简答:文件夹名称不要大写。

    尽管问题很小,但解决问题需要很长时间:shinyapps.io 和 windows 对大写字母的处理方式不同:内容保存在“Figures/”中,应用程序尝试访问“figures/” ,更不用说保管箱也搞砸了(图中的文件/在图中看到/...)

    我想知道这是否在文档中的某个地方......

    (在找到问题数小时后,我仍在努力解决问题......)

    【讨论】:

    • 我也有同样的问题。我似乎无法在 shinyapp.io 上创建目录...但它在本地运行良好 dir.create(file.path("outputs"))
    猜你喜欢
    • 2018-08-13
    • 2020-09-15
    • 2017-04-04
    • 1970-01-01
    • 2019-04-03
    • 2021-10-04
    • 2018-03-04
    • 2021-08-01
    • 2021-12-15
    相关资源
    最近更新 更多