Quarto complains about inexistent duplicate chunk labels when using tar_quarto() within workflow [help]
#1589
Help
Description(Also asked on Stack Overflow) Below is a reproducible example with a simpler project. I'm using The targets file: # Load packages
library(targets)
library(tarchetypes)
# Target options:
tar_option_set(
packages = c("tibble", "modelsummary")
)
# Target list
list(
tar_target(
name = data,
command = tibble(x = rnorm(100), y = rnorm(100))
),
tar_target(
name = model,
command = lm(y ~ x, data = data)
),
tar_quarto(
name = report,
path = "report.qmd",
quiet = FALSE
)
)The The error message with traceback: |
Replies: 2 comments 5 replies
|
It went through the first chunks - the chunk names as far as I remember evaluated fr duplication BEFORE the chunk processing starts. So my guess it,is is something in the part loaded dynamically when the code is rendered - in the target? |

I guess because
tar_quarto()only calls quarto render and this process is independent so you need what you use. For example you also needlibrary(targets).Can you try
source()in the qmd for the individual R scripts? And avoid usingtar_load_globals().