【发布时间】:2019-05-23 08:20:31
【问题描述】:
我正在尝试在 RStudio 中为一个包提供新闻。虽然默认 utils::news() 用于在内置查看器中生成基本 R 更改日志,但我无法让它适用于特定包;它抛出一个错误。该功能适用于 RGui 中的特定包。
RStudio 1.2.1335 中的全新 R 会话:
news() # this works
news(package = "ggplot2") # this doesn't
我在查看器中遇到的错误:Error in UseMethod("toHTML") : no applicable method for 'toHTML' applied to an object of class "NULL"
RGui 中的新 R 会话:
news()
news(package = "ggplot2") # both work perfectly
会话信息:
R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.6.0 tools_3.6.0 Rcpp_1.0.1 xml2_1.2.0 commonmark_1.7
如何让函数在 RStudio 中正确输出?如果这是不可能的,我如何在 RStudio 中运行该函数,但告诉它在查看器之外查看 HTML,例如,在像 RGui 这样的浏览器中?
【问题讨论】: