R Markdown:openBinaryFile:不存在(没有这样的文件或目录)

ZPe*_*Peh 7 r pandoc r-markdown shiny

我开发了一个闪亮的应用程序,允许用户通过R Markdown下载HTML报告。我正在尝试将自定义CSS和图像包含到我的rmarkdown文件中。但是,我不断收到此错误消息:

pandoc: Could not fetch (either css or image file)
openBinaryFile: does not exist (No such file or directory)
Run Code Online (Sandbox Code Playgroud)

当我在R Studio上编织.rmd文件时,它可以引用所需的图像文件或CSS。但是,当我运行Shiny应用程序并下载html文件时,出现上述错误消息。我什至尝试将图像和CSS文件与.rmd文件放在同一工作目录中,但无济于事...

output:
  html_document:
   css: pandoc.css

(same error message as above)
Run Code Online (Sandbox Code Playgroud)

一直在尝试为此找到解决方案,但似乎无法...有人可以在这里提供帮助吗?

Hal*_*oom 5

我有一个类似的问题。我没有使用完整的文件路径。我正在使用〜/ path / to / file。我将其更改为完整路径(即删除了〜/),它可以正常工作。


ACo*_*man 5

I just had this issue as well, but for me the reason was that the RStudio project was on a shared drive, and I had opened it through the network location. The problem was resolved when I closed out of the project, and opened it back up through a mapped network drive. (If when you run getwd() your location starts with \\, this is probably what is happening to you.)

  • 如何“通过映射的网络驱动器”打开文件?谢谢! (2认同)