簡體   English   中英

r knit to pdf / html:pandoc文檔轉換失敗,錯誤2

[英]r knit to pdf/html: pandoc document conversion failed with error 2

R Markdown文件似乎適用於Rstudio。 r Markdown文件可以轉換為單詞,但不能轉換為pdf / html。(昨天它給出了不同的問題,所以我在這里更改了我的問題。)任何幫助將不勝感激!

這是我的Markdown文件的上下文:

---
title: "Test"
author: "Test"
date: "2018/9/8"
output: html_document
---
## R test

```{r test}
x<-rnorm(500)
y<-rnorm(x*10)
ls()
plot(x,y)
rm(x,y)
```

This is an test.

這是我編織到html的結果:

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



processing file: test.Rmd
  |...........................................                      |  67%
label: test
  |.................................................................| 100%
  ordinary text without R code
/usr/local/bin/pandoc +RTS -K512m -RTS test.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output test.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable 'theme:bootstrap' --include-in-header /var/folders/_h/013l11r91m3gny4lqwsvh5qh0000gn/T//Rtmpfvxqld/rmarkdown-str268664475eb.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' 
output file: test.knit.md

--smart/-S has been removed.  Use +smart or -smart extension instead.
For example: pandoc -f markdown+smart -t markdown-smart.
Try pandoc --help for more information.
error: pandoc document conversion failed with error 2
stop processing

如果我編織pdf,這就是結果:

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

  |...........................................                      |  67%
label: test


processing file: test.Rmd
  |.................................................................| 100%
  ordinary text without R code

    /usr/local/bin/pandoc +RTS -K512m -RTS test.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output test.pdf --template /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rmarkdown/rmd/latex/default-1.17.0.2.tex --highlight-style tango --latex-engine /Library/TeX/texbin/pdflatex --variable graphics=yes --variable 'geometry:margin=1in' 
    output file: test.knit.md

    --latex-engine has been removed.  Use --pdf-engine instead.
    Try pandoc --help for more information.
    error: pandoc document conversion failed with error 2
    stop processing

一點背景可能會有所幫助:

Pandoc是一個Haskell二進制文件(即一個獨特的非R軟件),它與RStudio一起提供,以便運行RMarkdown轉換。 您似乎得到了一些棄用警告,例如:

  • --latex-engine has been removed. Use --pdf-engine instead.
  • --smart/-S has been removed. Use +smart or -smart extension instead.

這告訴我你可能有一個舊版本的RStudio,因此是舊版本的Pandoc。 您可能需要重新安裝RStudio以確保擁有適當的Pandoc版本,然后從那里進行調試。

此外,請確保使用最新版本重新安裝knitrrmarkdown

暫無
暫無

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

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