Last active
April 29, 2024 02:25
-
-
Save andrewheiss/43bbdedc67dc1389811afccf3c3118f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Testing" | |
--- | |
```{r} | |
#| label: fun-generate-chunks | |
#| include: false | |
generate_chunk <- function(id) { | |
paste0( | |
c( | |
paste0("```{r fig-", id, ", echo=FALSE}"), | |
"plot(density(rnorm(1000)))", | |
"```", "" | |
), | |
sep = "\n") | |
} | |
``` | |
See @fig-5: | |
`r knitr::knit(text = generate_chunk(5))` | |
And see @fig-9: | |
`r knitr::knit(text = generate_chunk(9))` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment