% Generated by roxygen2: do not edit by hand % Please edit documentation in R/spin.R \name{spin_child} \alias{spin_child} \title{Spin a child R script} \usage{ spin_child(input, format) } \arguments{ \item{input}{Filename of the input R script.} \item{format}{Passed to \code{format} in \code{spin()}. If not provided, it will be guessed from the current knitting process.} } \value{ A character string of the knitted R script. } \description{ This function is similar to \code{\link{knit_child}()} but is used in R scripts instead. When the main R script is not called via \code{\link{spin}()}, this function simply executes the child script via \code{\link{sys.source}()}, otherwise it calls \code{\link{spin}()} to spin the child script into a source document, and uses \code{\link{knit_child}()} to compile it. You can call this function in R code, or using the syntax of inline R expressions in \code{\link{spin}()} (e.g. \code{{{knitr::spin_child('script.R')}}}). }