当我[WARNING] Deprecated: --self-contained. use --embed-resources --standalone使用htmlwidgets::saveWidget(..., selfcontained = TRUE).
我不知道如何使用“嵌入资源”或“独立”作为函数中的参数。这只是最近开始的,想知道是否有其他人发生过此警告,或者知道为此使用的正确参数。更新了 RStudio 和软件包,但警告仍然存在。
使用 R 4.2.1、RStudio 2022.07.2+576“斑点 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")
Run Code Online (Sandbox Code Playgroud)