Cross post from GitHub discussions.
Is there any good way to render from a static branch? I'd like to read in target into an Rmd file. Here's a small example pipeline.
library(targets)
library(tarchetypes)
targets <- tar_map(
values = data.frame(sp = levels(iris$Species)),
tar_target(data, dplyr::filter(iris, Species == sp)),
tar_render(report, "report.Rmd")
)
And the corresponding Rmd
lines <- c(
"---",
"title: report.Rmd source file",
"output_format: html_document",
"---",
"Assume these lines are in report.Rmd.",
"```{r}",
"targets::tar_read(data)",
"```"
)
I'd like to be able to have the Rmd as is, but the actual target be data_setosa, etc.