簡體   English   中英

錯誤:pandoc 文檔轉換失敗,錯誤 61

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

我在數據框上運行create_report() ,而 R 正在返回一條錯誤消息。

我嘗試在以管理員身份打開 R 后卸載rmarkdown並重新安裝。 我也在這里嘗試過 Ron 的評論,它建議執行以下操作: Rmarkdown HTML 模板生成 pandoc 錯誤 61

file.edit("~/.Renviron")並在那里設置一個像這樣的本地路徑R_USER="C:/Users/my_name"

我跑了這個:

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)

而 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

我希望能夠在 HTML 文檔中生成圖表,如下頁底部所述:

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

這個問題源於(至少在我的情況下)因為使用的降價庫是一個網絡文件夾(在你的情況下“?/UNC/******/FolderRedirection/user.name/Documents/R/win- library/3.6/rmarkdown/rmd/h/default.html”)。 R 無法訪問此文件夾,因為權限缺失。

您必須將默認庫更改為您擁有完全權限的位置。 例如“C:/Program Files/R/R-3.6.2/library”。

在 RStudio 中,單擊 Tools>Install Packages.. 在“Install to library”下,您可以看到默認選項(在您的情況下,它應該是“?/UNC/******/FolderRedirection/user.name/Documents/ R/win-library/3.6/rmarkdown/rmd/h/default.html”)。 這里的第二個選項應該是“C:/Program Files/R/R-3.6.2/library”。

要更改此順序,即將“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

之后,您可能需要再次安裝 markdown 包。 這一次,它會直接安裝到“C:/Program Files/R/R-3.6.2/library”文件夾中。

現在,編織應該可以工作了,因為 R 將直接從您擁有完全權限的文件夾中使用該包。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM