【发布时间】:2022-11-23 11:42:51
【问题描述】:
使用 htmlwidgets::saveWidget(..., selfcontained = TRUE) 将绘图保存为独立的 html 小部件时,我不断收到 [WARNING] Deprecated: --self-contained. use --embed-resources --standalone。
我不知道如何使用“嵌入资源”或“独立”作为函数中的参数。这是最近才开始的,想知道是否有其他人遇到过此警告,或者知道用于此的正确参数。更新了 RStudio 和包,但警告仍然存在。
使用 R 4.2.1,RStudio 2022.07.2+576“Spotted Wakerobin”,htmlwidgets1.5.4。
library(plotly)
library(htmlwidgets)
fig <- plot_ly(x = 1:10, y = 1:10, type = "scatter", mode = "lines")
htmlwidgets::saveWidget(partial_bundle(fig), file = "plotly.html", selfcontained = TRUE)
utils::browseURL("plotly.html")
【问题讨论】:
-
我无法使用 plotly v4.10.1 和 htmlwidgets v1.5.4 以及 RStudio 2022.07.1 Build 554 重现该问题。我在上面留下了一个示例。但是,在这里您可以找到related issue。该警告似乎是由pandoc 提出的。也许最新的 RStudio 安装程序附带了一个新的 pandoc 版本?
标签: html r plotly htmlwidgets