有什么方法可以让我在R中打开一个Rmd文件,只使用yaml而不是其他所有东西?
我喜欢这个..。
---
title: "Untitled"
author: ""
date: ""
output: html_document
---而不是..。
---
title: "Untitled"
author: ""
date: ""
output: html_document
---
{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}摘要(Cars)
## Including Plots
You can also embed plots, for example:
```javascript绘图(压力)
注意,echo = FALSE参数被添加到代码块中,以防止打印生成绘图的R代码。
发布于 2021-03-18 20:10:31
据我所知,你有两个选择:
1.使用{rmarkdown::草案()}
您需要本地保存模板,并使用draft()函数创建一个新文件。
draft(file, template, package = NULL, create_dir = "default", edit = TRUE)
2.创建带有模板的包并安装包。
您可以使用自定义模板复制和调整哈珀博士包,并在本地安装该包。此选项的优点是允许您从RStudio的新文件接口中选择模板。
要创建模板,请遵循谢一辉,J.J.Allaire和Grolemund的第17章来自R标记:最终指南。

https://stackoverflow.com/questions/66697953
复制相似问题