简体   繁体   English

错误:pandoc 文档转换失败,错误 61

[英]Error: pandoc document conversion failed with error 61

I am running create_report() on a data frame, and R is returning an error message.我在数据框上运行create_report() ,而 R 正在返回一条错误消息。

I have tried uninstalling rmarkdown and reinstalling after opening R as an admin.我尝试在以管理员身份打开 R 后卸载rmarkdown并重新安装。 I have also tried Ron's comment here which suggests doing the following below: Rmarkdown HTML Template produces pandoc error 61我也在这里尝试过 Ron 的评论,它建议执行以下操作: Rmarkdown HTML 模板生成 pandoc 错误 61

file.edit("~/.Renviron") and setting there a local path like this R_USER="C:/Users/my_name" file.edit("~/.Renviron")并在那里设置一个像这样的本地路径R_USER="C:/Users/my_name"

I ran this:我跑了这个:

dbconnection <- odbcDriverConnect("Driver=SQL Server;Server=******;Database=*******;trusted_connection=yes")
initdata <- sqlQuery(dbconnection,paste("SELECT * FROM OPENQUERY(****,'SELECT fid****, fid****, fid**** FROM *************') WHERE fid**** = 'XXXXXXX' AND fid**** = 'XXXXXX';"))
odbcClose(dbconnection)

summary(initdata)
glimpse(initdata)
vis_miss(initdata)
vis_dat(initdata)
create_report(initdata)

And RStudio returns this:而 RStudio 返回这个:

Could not fetch http://?/UNC/******/FolderRedirection/user.name/Documents/R/win-library/3.6/rmarkdown/rmd/h/default.html
HttpExceptionRequest Request {
  host                 = ""
  port                 = 80
  secure               = False
  requestHeaders       = []
  path                 = "/"
  queryString          = "?/UNC/******/FolderRedirection/user.name/Documents/R/win-library/3.6/rmarkdown/rmd/h/default.html"
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (InvalidDestinationHost "")
Quitting from lines 27-36 (test.Rmd) 
Error: pandoc document conversion failed with error 61
Execution halted

I expect to be able to produce charts in an HTML document as described at the bottom of the following page:我希望能够在 HTML 文档中生成图表,如下页底部所述:

https://www.littlemissdata.com/blog/simple-eda https://www.littlemissdata.com/blog/simple-eda

This problem stems (at least in my case) from the fact that the used markdown library is a network folder (in your case "?/UNC/******/FolderRedirection/user.name/Documents/R/win-library/3.6/rmarkdown/rmd/h/default.html").这个问题源于(至少在我的情况下)因为使用的降价库是一个网络文件夹(在你的情况下“?/UNC/******/FolderRedirection/user.name/Documents/R/win- library/3.6/rmarkdown/rmd/h/default.html”)。 R cannot access this folder because rights are missing. R 无法访问此文件夹,因为权限缺失。

You have to change your default library to a place where you have full rights.您必须将默认库更改为您拥有完全权限的位置。 For example "C:/Program Files/R/R-3.6.2/library".例如“C:/Program Files/R/R-3.6.2/library”。

In RStudio, click on Tools>Install Packages.. Under "Install to library" you can see the default option (in your case it should be "?/UNC/******/FolderRedirection/user.name/Documents/R/win-library/3.6/rmarkdown/rmd/h/default.html").在 RStudio 中,单击 Tools>Install Packages.. 在“Install to library”下,您可以看到默认选项(在您的情况下,它应该是“?/UNC/******/FolderRedirection/user.name/Documents/ R/win-library/3.6/rmarkdown/rmd/h/default.html”)。 The second option here should be "C:/Program Files/R/R-3.6.2/library".这里的第二个选项应该是“C:/Program Files/R/R-3.6.2/library”。

To change this order, ie to make the "C:/Program Files/R/R-3.6.2/library" folder the default folder, you have to use the following code (execute the code in a new R file) :要更改此顺序,即将“C:/Program Files/R/R-3.6.2/library”文件夹设为默认文件夹,您必须使用以下代码(在新的 R 文件中执行代码):

bothPaths <- .libPaths()   # extract both paths
bothPaths <- c(bothPaths [2], bothPaths [1])  # change order
.libPaths(bothPaths )  # modify the order

After that, you might have to install the markdown package again.之后,您可能需要再次安装 markdown 包。 This time, it will be directly installed into the "C:/Program Files/R/R-3.6.2/library" folder.这一次,它会直接安装到“C:/Program Files/R/R-3.6.2/library”文件夹中。

Now, knitting should be working, because R will use the package straight from a folder where you have full rights.现在,编织应该可以工作了,因为 R 将直接从您拥有完全权限的文件夹中使用该包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM