Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

googleVis in markdown throws error 67

Markdown which previously rendered nicely in html simply using the Rstudio 'knit' button now will not. This is windows, R3.4.1, and updated knitr and rmarkdown, and the whole worked fine last week. I have minimal .rprofile, and have no packages loaded prior to knitting the minimal doc below. A 'manual' knit as follows works ie the gvisTable and also mathjax is properly rendered in html, so this should not be a problem with my internet connection today (I also tried an alternative connection but no different):

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

However the following (which I believe is what the 'knit' button does, borrowed from What does “Knit HTML” do in Rstudio 0.98?) throws an error

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

The error message in the is rather long so I append it now, URLs censored because I lack reputation. I have tried googling, SO etc but no result. Help appreciated.

"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

---------------the minimal document, which renders fine if I comment out the gvisTable line or use the markdown route described above and not 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)
```
like image 237
Gerry Avatar asked Oct 29 '22 01:10

Gerry


1 Answers

I was having the same problem since a few days with a Markdown file which previously rendered fine. I am having Windows 7 x64 SP1, R version 3.4.1, googleVis 0.6.2, rmarkdown 1.6, knitr 1.17.

There are two workarounds which solved the issue for me:

1) Running the script with

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

worked, though the output is no longer a standalone HTML file but has dependencies in external files. This is not an option for me since I need to be able to share the HTML file with colleagues.

2) The only other fix I found was to use a newer Pandoc version. I was previously having pandoc 1.17.2 and am now running pandoc 2.0.

You can check your pandoc version in C:\Program Files\RStudio\bin\pandoc by running the command pandoc --version in the command prompt.

The way I updated Pandoc was to

  • download the nightly-build pandoc-windows-7c20fab3.zip from https://github.com/pandoc-extras/pandoc-nightly/releases/tag/hash-7c20fab3
  • unzip and replace the pandoc.exe and pandoc-citeproc.exe in C:\Program Files\RStudio\bin\pandoc with their newer versions (while keeping the old ones as backup).

Running the Markdown script with the updated Pandoc first yielded an error (pandoc document conversion failed with error 2) but this was resolved with

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

Probably not the most elegant solution, but so far the only one that worked for me.

like image 83
Sarah Avatar answered Nov 09 '22 07:11

Sarah