r - 如何将交互式绘图添加到 Github 上的自述文件(在 R 中生成)
问题描述
我正在用 R 编写我的第一个包,并希望最初可以在我的 Github 上使用它并最终提交给 CRAN 和/或 Bioconductor。这是我在 github 上的包的链接:https ://github.com/octaviamd/interactmapper我的包的主要功能是这些交互式绘图,您可以使用我的包生成这些交互式绘图,我希望包括其中一些作为示例我的 README 文件中的包可以做什么,但不幸的是,github 文档似乎不允许交互元素。是否有解决方法,以便我可以成功地演示我的包在 README 文件中的工作方式?
我尝试在生成的 github_document README.Rmd 中运行以下命令usethis::use_readme_rmd()
devtools::install_github("octaviamd/interactmapper")
library(interactmapper)
interactmapper::interact_qual(iris[,1:4], iris$Species, "UMAP")
但是当我尝试编织 Rmarkdown 文档时,我收到以下错误消息:
Error: Functions that produce HTML output found in document targeting gfm-ascii_identifiers output.
Please change the output type of this document to HTML. Alternatively, you can allow
HTML output in non-HTML formats by adding this option to the YAML front-matter of
your rmarkdown file:
always_allow_html: yes
Note however that the HTML output will not be visible in non-HTML formats.
Execution halted
我不知道是否最好将 README 文件保留为 github_document 以便于在 github 上显示,或者我切换到 html 是否会使其根本不起作用或会影响我向 CRAN/Bioconductor 的提交。我尝试将该always_allow_html: yes
行添加到 YAML,但是,正如错误消息所述,在编织时,它会生成文档,但根本没有我的情节。
如何在 github 上的 README 文件中成功显示我的交互式绘图?如果您以前有这方面的经验或对如何做到这一点有想法,我非常感谢您的意见!先感谢您!!
解决方案
推荐阅读
- reactjs - 如何使用 React-testing-library 测试 styled-components 属性?
- javascript - 这里的第二个功能可能有什么问题?
- inno-setup - Inno Setup DelTree 不删除顶级文件夹
- swift - MVVM:将 View 与带有闭包的 ViewModel 绑定,这如何导致保留周期?
- android-jetpack-compose - DropdownMenuItem不可点击的android撰写
- flutter - 我怎样才能得到毫秒SinceEpoch 直到 00.00 点而不是直到现在的详细秒数
- amazon-rds - 如何在 AWS CDK 项目/堆栈中导入现有的 Aurora MySQL 集群?
- ios - 更新到 Xcode 13 后出现错误破坏了应用程序
- reactjs - 用于从 App.js 更新 UI 的全局变量
- python - Python - 多个变量的子