首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在R Markdown中嵌入R markdown代码?

如何在R Markdown中嵌入R markdown代码?
EN

Stack Overflow用户
提问于 2020-08-10 00:15:17
回答 1查看 50关注 0票数 0

我正在教学生如何创建/编辑R标记文件。所以我希望在我的R markdown文件中有一个R markdown模板。示例如下:

代码语言:javascript
复制
---
title: "file_check"
author: "James"
date: "8/7/2020"
output: html_document
---

Learn by copying this into blank .Rmd file:

---
title: "Template"
author: "Your Name"
date: "Specify Date"
output: html_document
---

This is how you plot 
```{r}

绘图(1:10)

代码语言:javascript
复制

当我运行这个程序时,我显然会得到错误,但我知道必须有一种快速/有效的方法来做到这一点,因为R markdown网站具有这种功能。

EN

回答 1

Stack Overflow用户

发布于 2020-08-10 00:34:36

您可以使用text块:

代码语言:javascript
复制
---
title: "file_check"
author: "James"
date: "8/7/2020"
output: html_document
---

Learn by copying this into blank .Rmd file:
```{text} 
--- 
title: "Template" 
author: "Your Name"
date: "Specify Date"
output: html_document
---
```

This is how you plot 
```{r}
plot(1:10)
```

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

https://stackoverflow.com/questions/63328652

复制
相关文章

相似问题

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