if (interactive()) {
# Create a temporary directory for testing
tmp_dir <- tempdir()
# Write the Quarto & associated files for a custom YAML with reusable metadata
write_quarto(path = tempdir(), filename = "analysis")
# Write the Quarto file with a template requiring more DIY
write_quarto(path = tempdir(), filename = "analysis_basic", example = FALSE)
# Confirm the file was created (optional, for user confirmation)
file.exists(file.path(tmp_dir, "analysis.qmd"))
file.exists(file.path(tmp_dir, "analysis_basic.qmd"))
# Clean up: Remove the created file
unlink(list.files(tempdir(), full.names = TRUE), recursive = TRUE)
}
Run the code above in your browser using DataLab