gpt4 book ai didi

r - Knit 不渲染 googleVis

转载 作者:行者123 更新时间:2023-12-02 08:53:24 25 4
gpt4 key购买 nike

我在 Windows 7 中使用 Rsutdio 和 knitr 渲染简单的 gvisTable 时遇到问题。这是我的代码

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

这是我的错误:

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

我的 Rstudio 版本是:0.98.1091我的 SessionInfo 是:

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

或者这段代码工作得很好:

```{r results='asis'}
require(knitr)
data(iris)
kable(iris)
```

您知道 googleVis 在这种情况下存在的问题吗?预先感谢您的帮助。

最佳答案

Pandoc 正在尝试下载 googleVis 图表,以便它可以在您的文档中嵌入静态/离线副本。您可以通过告诉 Pandoc 不要创建独立文档(即不要执行导致问题的资源嵌入)来解决该问题 - 将其添加到文档的顶部,或者只是 之间的文本 - - 如果您已有 YAML header :

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

Pandoc 通过 https 获取资源应该不会有问题。如果您有时间在 rmarkdown 工作流程之外重现问题(即在普通 Markdown -> HTML 转换上)并发现它仍然是一个问题,请向 Pandoc 提交问题:https://github.com/jgm/pandoc/issues

关于r - Knit 不渲染 googleVis,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27490026/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com