将 HTML 转换为 R Markdown [英] Convert HTML to R Markdown

查看:112
本文介绍了将 HTML 转换为 R Markdown的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法转换html文件,比如https://cran.r-project.org/web/packages/tidytext/vignettes/tidytext.html,并将其转换为可执行的 R Markdown 文件(rmd)?

Is there a way to convert an html file, such as https://cran.r-project.org/web/packages/tidytext/vignettes/tidytext.html, and convert it to an executable R Markdown file (rmd)?

推荐答案

简而言之,没有.

pandoc 二进制文件几乎是非常棒的,我用它来转换将 Rd 文件中的 html 输出放回 Markdown(将包含在其他 Markdown 文档中).

The pandoc binary is almost pure awesomeness, and I use it eg to convert the html output from an Rd file back into markdown (to be included in other markdown documents).

但是它使用 pandoc 它知道:从 markdown 转换为 html 等. pandoc 本身对 R 一无所知.所以除了获得 代码从它创建的输出返回,你有一个工具不匹配.

But that uses pandoc for what it knows: convert from markdown to html etc. pandoc itself knows nothing about R. So apart from the metaphysical difficulty of getting the code back from the output it created, you have a tool mismatch.

所以在某些情况下:您可能需要原始源代码,因为您无法从它产生的 html 输出重新创建 Rmd.

So in some: you probably want the original source code as you cannot recreate Rmd from the html output it produces.

这篇关于将 HTML 转换为 R Markdown的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆