如何从Knitr访问Yaml元数据 [英] how to access yaml metadata from knitr
本文介绍了如何从Knitr访问Yaml元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
knitr是否知道YAML数据的值,例如title:或date:或some_custom_field:正在编译带有YAML标头的rmarkdown文档时?
Does knitr know the value of YAML data e.g. title: or date: or some_custom_field: while it is compiling an rmarkdown doc with a YAML header?
我希望能够做到这一点(伪代码)
I would like to be able to do this (pseudocode)
---
title: my title
---
The title of this document is `r knitrs_yaml_array("title")`
推荐答案
以list(title = ...)
形式的列表形式存储在rmarkdown::metadata
中.
That is stored in rmarkdown::metadata
as a list of the form list(title = ...)
.
这篇关于如何从Knitr访问Yaml元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文