Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

r - Knitr does not render googleVis

I have a trouble with Rsutdio and knitr in Windows 7 for rendering a simple gvisTable. Here is my code

```{r results='asis'}
require(googleVis)
op <- options(gvis.plot.tag="chart")
data(iris)
t = gvisTable(data = iris)
print(t)
```

and here is my error :

pandoc.exe: Failed to retrieve https://www.google.com/jsapi?callback=displayChartTableID14c4345d7f3 FailedConnectionException2 "www.google.com" 443 True connect: failed (Connection timed out (WSAETIMEDOUT)) Erreur : pandoc document conversion failed with error 61

My Rstudio version is : 0.98.1091 And my SessionInfo is :

R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252    LC_MONETARY=French_France.1252
[4] LC_NUMERIC=C                   LC_TIME=French_France.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] plotrix_3.5-10   data.table_1.9.4 googleVis_0.5.6  knitr_1.8       

loaded via a namespace (and not attached):
 [1] chron_2.3-45     digest_0.6.4     evaluate_0.5.5   formatR_1.0      htmltools_0.2.6  plyr_1.8.1       Rcpp_0.11.3     
 [8] reshape2_1.4     RJSONIO_1.3-0    rmarkdown_0.3.11 stringr_0.6.2    tools_3.1.2      yaml_2.1.13
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Pandoc is trying to download the googleVis chart so that it can embed a static/offline copy in your document. You can work around the problem by telling Pandoc not to create a standalone document (i.e. don't do the resource embedding that's causing the problem)--add this to the top of your document, or just the text between --- if you already have a YAML header:

---
output:
  html_document:
    self_contained: no
---

Pandoc shouldn't have a problem fetching resources over https. If you have time to repro the problem outside the rmarkdown workflow (i.e. on a vanilla Markdown -> HTML conversion) and find that it's still an issue, please file an issue for Pandoc: https://github.com/jgm/pandoc/issues.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...