[英]How to generate README.md from README.Rmd for R package?
Inspecting dplyr shows there's both a README.md
file and a README.Rmd
file.检查dplyr显示有一个
README.md
文件和一个README.Rmd
文件。
In the .md
file, it says在
.md
文件中,它说
README.md is generated from README.Rmd.
README.md 是从 README.Rmd 生成的。 Please edit that file
请编辑该文件
It's easy enough to create the .Rmd
file, but how then is the .md
file generated?创建
.Rmd
文件很容易,但是.md
文件是如何生成的呢? Is it using roxygen2 or is there some terminal command (or something else)?它是使用 roxygen2 还是有一些终端命令(或其他命令)?
Simply set output: github_document
in the yaml at the top of the .Rmd
and click knit.只需在
.Rmd
顶部的 yaml 中设置output: github_document
.Rmd
并单击 knit。
Here's a small but complete RMarkdown document as an example:下面以一个小而完整的 RMarkdown 文档为例:
---
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## R Markdown
This is an R Markdown document that generates a github readme.md file.
```{r}
summary(iris)
```
Then simply click 'knit' like so:然后只需像这样单击“编织”:
Note:笔记:
output: md_document
instead (but if it's for a github readme, you'll most likely want the github flavored version)output: md_document
(但如果它用于 github 自述文件,您很可能需要 github 风味的版本)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.