首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何更改设置以打开Rmd文件,而不使用R中的默认脚本?

问如何更改设置以打开Rmd文件,而不使用R中的默认脚本?
EN

Stack Overflow用户
提问于 2021-03-18 19:35:22
回答 1查看 330关注 0票数 1

有什么方法可以让我在R中打开一个Rmd文件,只使用yaml而不是其他所有东西?

我喜欢这个..。

代码语言:javascript
复制
---
title: "Untitled"
author: ""
date: ""
output: html_document
---

而不是..。

代码语言:javascript
复制
---
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)

代码语言:javascript
复制
## Including Plots

You can also embed plots, for example:

```javascript

绘图(压力)

代码语言:javascript
复制

注意,echo = FALSE参数被添加到代码块中,以防止打印生成绘图的R代码。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 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标记:最终指南。

​

​

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66697953

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档