2

尝试在 Mozilla Firefox 中打开与 knitr 放在一起的 html 文档时出现以下错误。plotly该错误是由包组成的图形元素的结果。

unknownError: error occurred while processing 
'getCachedMessages: out of memory

rmarkdown 文件的全部内容(默认其他所有内容):

library(plotly)
library(ggplot2)
theData <- data.frame(A=1:26, B=letters, C=rnorm(26,19))

g<-ggplot(theData, aes(x=A, y=C)) +
  geom_point()
ggplotly(g)

我有最新版本的 Firefox。我似乎在查看其他带有情节元素的页面时没有问题。该页面在IE中工作,没问题。

4

2 回答 2

7

(抱歉——我没有足够的分数在评论中回复)

R + Rmd + plotly + Firefox 我遇到了同样的问题(但 IE 或 Opera 没有问题)。Github /ropensci / plotly 提出了以下问题 - 但截至 2017-01-20 没有解决方案:

  1. plotly + FlexDashboard + Firefox = 巨大的内存消耗 #721
  2. Firefox 中 RMarkdown 的性能非常差 #483
  3. R 库:Firefox 速度大幅下降,但 Chrome #17 没有(github/plotly/plotly.js/issues/17)
于 2017-01-20T10:26:40.620 回答
0

到目前为止(2018-05-08)似乎这个问题仍然存在。但是cpsievert在 GitHub 上提到了一种解决方法(有关链接,请参见 camelCase 的回答)。

您必须像这样添加self_contained: false到 YAML 标头:

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

这个 hack 的问题是你将不再有一个独立的 .html 文件。有关详细信息,请参阅https://rmarkdown.rstudio.com/html_document_format.html上的主题文档依赖关系。

于 2018-05-09T01:54:33.610 回答