This function is similar to knit_child()
but is used in R
scripts instead. When the main R script is not called via
spin()
, this function simply executes the child script via
sys.source()
, otherwise it calls spin()
to spin
the child script into a source document, and uses knit_child()
to compile it. You can call this function in R code, or using the syntax of
inline R expressions in spin()
(e.g.
{{knitr::spin_child('script.R')}}
).
spin_child(input, format)
Filename of the input R script.
Passed to format
in spin()
. If not
provided, it will be guessed from the current knitting process.
A character string of the knitted R script.