【问题标题】:googleVis in markdown throws error 67markdown 中的 googleVis 抛出错误 67
【发布时间】:2017-09-18 11:45:14
【问题描述】:

以前只需使用 Rstudio 'knit' 按钮就可以很好地在 html 中呈现的 Markdown 现在不会了。这是 windows,R3.4.1,以及更新的 knitr 和 rmarkdown,上周整体运行良好。我有最小的 .rprofile,并且在编写下面的最小文档之前没有加载任何包。如下所示的“手动”编织工作,即 gvisTable 和 mathjax 在 html 中正确呈现,所以这不应该是我今天的互联网连接的问题(我也尝试了替代连接,但没有什么不同):

knitr::knit(in,out=md) markdown::markdownToHTML(md,ht)

但是以下(我相信这是“编织”按钮的作用,借用自 What does “Knit HTML” do in Rstudio 0.98?)会引发错误

rmarkdown::render(pp, 'html_document', 'new_titel.html')

中的错误消息相当长,所以我现在附加它,因为我缺乏声誉,URL 被审查。我试过谷歌搜索,所以等等,但没有结果。帮助表示赞赏。

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS tmp1.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output new_titel.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template "censored" --no-highlight --variable highlightjs=1 --variable "theme:bootstrap" --include-in-header "censored" --mathjax --variable "censored" 
pandoc.exe: Could not fetch censored
HttpExceptionRequest Request {
  host                 = "www.google.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/jsapi"
  queryString          = "?callback=displayChartTableID1d98417f33e7"
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (InternalException (HandshakeFailed Error_EOF))
Warning: running command '"" +RTS -K512m -RTS tmp1.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output new_titel.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template "censored" --no-highlight --variable highlightjs=1 --variable "theme:bootstrap" --include-in-header "censored" --mathjax --variable "mathjax-url:censored-not-enough-reputation"' had status 67
Error: pandoc document conversion failed with error 67

---------------最小的文档,如果我注释掉 gvisTable 行或使用上面描述的 markdown 路由而不是 rmarkdown,它会呈现良好:

---
title: "Untitled"
output:
  html_document: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
####title

body

$x=y$ 
```{r , echo=FALSE, results='asis'}
require(knitr)
kable(mtcars[1:2,])
require(googleVis)
gvisTable(mtcars)
```

【问题讨论】:

    标签: r knitr r-markdown googlevis


    【解决方案1】:

    几天前我遇到了同样的问题,之前渲染的 Markdown 文件很好。 我有 Windows 7 x64 SP1、R 版本 3.4.1、googleVis 0.6.2、rmarkdown 1.6、knitr 1.17。

    有两种解决方法为我解决了这个问题:

    1) 运行脚本

    ---
    title: "Untitled"
    output:
      html_document:
        self_contained: false
    ---
    

    工作,虽然输出不再是一个独立的 HTML 文件,而是在外部文件中有依赖关系。 这对我来说不是一个选项,因为我需要能够与同事共享 HTML 文件。

    2) 我发现的唯一其他修复是使用更新的 Pandoc 版本。我之前使用的是 pandoc 1.17.2,现在正在运行 pandoc 2.0。

    您可以在以下位置查看您的 pandoc 版本 C:\Program Files\RStudio\bin\pandoc 通过在命令提示符下运行命令pandoc --version

    我更新 Pandoc 的方式是

    使用更新后的 Pandoc 运行 Markdown 脚本首先会产生一个错误 (pandoc document conversion failed with error 2),但这已解决

    ---
    title: "Untitled"
    output:
      html_document:
        smart: false
    ---
    

    可能不是最优雅的解决方案,但迄今为止唯一对我有用的解决方案。

    【讨论】:

    • 当我完全按照描述进行咒语时,这对我有用。该版本没有,但每晚,是的,并且没有 smart: false 我得到错误 2 加上使用标志的提示。我仍然不确定我是如何破坏工具的,但这个解决方案是最受欢迎的。所以规则!
    猜你喜欢
    • 1970-01-01
    • 2017-03-11
    • 2021-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-08
    • 1970-01-01
    • 2019-01-21
    相关资源
    最近更新 更多