I'm using Rstudio to create Rmd reports, and I'd like to be able to insert meta tags into the <head>
when the Rmd is knit into html.
From the documentation on knitr options I thought I could set the header option to insert text between the <head>
tags like so:
```{r}
opts_knit$set(header = "<meta name=\"description\" content=\"this is a description\">")
```
However, nothing seems to be inserted. Am I doing something wrong or is this not possible?
You use a line in the yaml header that reads in an external .html file with your header snippet in it as per this link.
Here is a slight modification from the link above including your code and includes the option the creation of the external .html header text in the .Rmd file which is not required: