The following .Rmd
is what I think should produce what I'm looking for:
---
title: "Untitled"
date: "10/9/2021"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
full_var <- function(var) {
cat("### `", var, "` {-} \n")
cat("```{r}", "\n")
cat("print('test')", "\n")
cat("```", "\n")
}
vars <- c("1", "2", "3")
```
```{r results = "asis"}
purrr::walk(vars, full_var)
```
Instead, it looks like:
Why is the print('test')
not being evaluated and instead being presented as a code block?