问题
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
---
However, is there a way to have this header included using knit2html
from within the R console? Thanks!
回答1:
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.
来源:https://stackoverflow.com/questions/29518223/headers-in-knitr