spin_child: Spin a child R script

View source: R/spin.R

spin_childR Documentation

Spin a child R script

Description

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')}}).

Usage

spin_child(input, format)

Arguments

input

Filename of the input R script.

format

Passed to format in spin(). If not provided, it will be guessed from the current knitting process.

Value

A character string of the knitted R script.


yihui/knitr documentation built on Nov. 24, 2024, 5:10 a.m.