处理元数据中的输出选项

时间:2014-08-24 00:11:44

标签: r knitr rstudio r-markdown

我在RStudio中创建了一个新的RMarkdown文件(使用最新版本的R和RStudio)。标头默认为:

---
title: "Untitled"
author: "David Arnold"
date: "August 23, 2014"
output: html_document
---

然后我去:http://rmarkdown.rstudio.com/?version=0.98.1028&mode=desktop

我认为:

---
title: "Sample Document"
output:
  html_document:
    toc: true
    theme: united
---

所以我尝试添加到我的标题:

---
title: "Untitled"
author: "David Arnold"
date: "August 23, 2014"
output: html_document:
toc: true
---

但是现在当我使用knitHTML进行编译时,我得到以下响应:

Error in yaml::yaml.load(front_matter) : 
  Scanner error: mapping values are not allowed in this context at line 4, column 22
Calls: <Anonymous> -> parse_yaml_front_matter -> <Anonymous> -> .Call
Execution halted

我做错了什么?

1 个答案:

答案 0 :(得分:1)

我认为你需要在html_document后删除冒号(即。:):

相关问题