首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >从共享驱动器呈现rmarkdown时出现问题

从共享驱动器呈现rmarkdown时出现问题
EN

Stack Overflow用户
提问于 2019-03-20 03:31:47
回答 2查看 2.9K关注 0票数 3

当我的RMD文件在共享驱动器上时,我无法呈现标记文件。我使用的是rmarkdown版本1.12,R版本3.5.3,64位Windows 10,pandoc 2.7.1。

我不能渲染为html,pdf或word文档。

此操作失败(我的文件夹路径中没有空格或标点符号):

rmarkdown::render("//cor.local/subfolders/Martin/aNewRMD.RMD")

但这是成功的:

rmarkdown::render("C:/Users/Martin/Documents/aNewRMD.RMD")

(我只是使用RStudio打开的默认新.RMD文件)。

错误消息:

processing file: aNewRMD.RMD
  |.........                                                        |  14%
  ordinary text without R code

  |...................                                              |  29%
label: setup (with options) 
List of 1
 $ include: logi FALSE

  |............................                                     |  43%
  ordinary text without R code

  |.....................................                            |  57%
label: cars
  |..............................................                   |  71%
  ordinary text without R code

  |........................................................         |  86%
label: pressure (with options) 
List of 1
 $ echo: logi FALSE

  |.................................................................| 100%
  ordinary text without R code


output file: aNewRMD.knit.md

"C:/Pandoc/pandoc" +RTS -K512m -RTS aNewRMD.utf8.md --to html4 --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart --output aNewRMD.html --email-obfuscation none --self-contained --standalone --section-divs --template "C:\Users\Martin\Documents\R\win-library\3.5\rmarkdown\rmd\h\default.html" --no-highlight --variable highlightjs=1 --variable "theme:bootstrap" --include-in-header "C:\Users\Martin\AppData\Local\Temp\RtmpGoqMWG\rmarkdown-str421411883120.html" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" 
pandoc.exe: aNewRMD.utf8.md: openBinaryFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 1
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-03-20 04:32:06

我相信R还不知道如何为网络共享说出任意的URI。尽管我猜测一些函数(和其他包)可能支持其他方案,但download.file帮助页面上写道

 The function 'download.file' can be used to download a single file
 as described by 'url' from the internet and store it in
 'destfile'.  The 'url' must start with a scheme such as 'http://',
 'https://', 'ftp://' or 'file://'.

您对"//cor.local/subfolders/Martin/aNewRMD.RMD"所做的是告诉它对名为cor.local (以某种方式进行身份验证)的主机使用windows文件共享协议(smb、cifs等),并导航到相应的子目录。

我的建议是:让windows提前处理基本身份验证,并“挂载”它,这样你本地计算机上的每个应用程序都会将其视为“本地”,但将它挂载到一个驱动器号上:

C:\Users\AM4337> net use /user:yourdomain\youruser g: \\cor.local\subfolders

(它应该询问您的密码),然后在本地使用/使用它

R> rmarkdown::render("G:/Martin/aNewRMD.RMD")
票数 5
EN

Stack Overflow用户

发布于 2019-07-16 22:07:29

在组织升级到windows10之后,当多个用户试图运行现有的r进程时,我也遇到了同样的问题:错误: pandoc文档转换失败,错误为1。

将项目文件夹更改为RStudio项目解决了此问题。RStudio项目使用每个用户的本地路径设置自己的工作目录,因此将网络路径替换为本地字母路径。感谢@r2evans解释此问题并启用此解决方法。

(对于单独的回答,很抱歉,我没有资格对@r2evans的回答发表评论。)

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55248740

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档