Hi, I've rendered a RMarkdown report with a template using something like this: Generating markdown report in shiny? - #12 by phil
The render includes:
render(tempReport, output_file = file,
params = params,
envir = new.env(parent = globalenv())
But the path where the template and word docx are is tempdir()
.
I want to source functions from my directory using something like knitr_knit_global()
: 16.1 Source external R scripts | R Markdown Cookbook (bookdown.org)
This doesn't work though and the document doesn't render
source("data/app_datasets.R", local = knitr::knit_global())
When I print list.files()
in the markdown document, I am in the temp dir and can't seem to source the functions that I require. Any ideas?