Can anyone give me an example to add libraries and local functions with the klmr::box package in a rmarkdown document?
I am aware of their use in Rhino´s framework, but I feel a bit confused where can I declare modules and libraries in a YAML + Rmarkdown file.
The way is to remember he location of the .Rmd file. The difference with the package
here::here
is that it does not go backwards from the .Rmd location. box yes, using..
in fromt of module's statements.In their invocation, keep one eye in the relative locations:
input, output: not passed to the internal .Rmd. So they begin from the current working enviroment where render is executed.
lib, math, css: are relative to the final output file location.
the knit_root_dir param can change the working directory where render and knit is executed. Keep it in mind this possibility if your .Rmd calls from inside modules to readjust their locations.