簡體   English   中英

htmlwidgets::saveWidget() 中棄用的參數“selfcontained”

[英]Argument "selfcontained" deprecated in htmlwidgets::saveWidget()

我不斷收到[WARNING] Deprecated: --self-contained. use --embed-resources --standalone [WARNING] Deprecated: --self-contained. use --embed-resources --standalone將繪圖保存為獨立的 html 小部件時,使用htmlwidgets::saveWidget(..., selfcontained = TRUE)

我不知道如何使用“嵌入資源”或“獨立”作為函數中的參數。 這是最近才開始的,想知道是否有其他人遇到過此警告,或者知道用於此的正確參數。 更新了 RStudio 和包,但警告仍然存在。

使用 R 4.2.1、RStudio 2022.07.2+576“Spotted Wakerobin”、 htmlwidgets 1.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")

這是 2.19 版中的 Pandoc 更改。 您可以使用htmlwidgets:::pandoc_available(); htmlwidgets:::.pandoc$version htmlwidgets:::pandoc_available(); htmlwidgets:::.pandoc$version 我認為 RStudio 分發了 2.18 版,但它們可能已經更新,或者您可能已經單獨安裝了它。

Pandoc 更改日志位於: https ://pandoc.org/releases.html。

我認為除了編輯htmlwidgets源代碼之外沒有任何方法可以解決這個問題。 也許這會在下一個版本中修復?

編輯添加:此更改已在rmarkdown中處理了一段時間,但htmlwidgets直接調用了 Pandoc。 htmlwidgets的下一個版本 (1.6.0) 將通過讓rmarkdown處理調用來修復它。 這也應該面向未來。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM