Knitr 中的标头 [英] Headers in Knitr
本文介绍了Knitr 中的标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在 R 控制台中使用 knitr (不是RStudio) 来处理标题.有很多使用 YAML 标头的示例,例如:
Is there a way to use knitr from within the R console (not RStudio) to process a header. There are many examples using YAML headers such as:
---
title: "Habits"
author: John Doe
date: March 22, 2005
output: html_document
---
但是,有没有办法在 R 控制台中使用 knit2html
包含此标头?谢谢!
However, is there a way to have this header included using knit2html
from within the R console? Thanks!
推荐答案
不,YAML 元数据特定于 R Markdown v2,即 rmarkdown 包.knitr::knit2html()
函数仅适用于 R Markdown v1.
No, the YAML metadata is specific to R Markdown v2, i.e. the rmarkdown package. The knitr::knit2html()
function is for R Markdown v1 only.
这篇关于Knitr 中的标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文