knit_child

From knitr v1.7
0th

Percentile

Knit a child document

This function knits a child document and returns a character string to input the result into the main document. It is designed to be used in the chunk option child and serves as the alternative to the SweaveInput command in Sweave.

Usage
knit_child(..., options = NULL, envir = knit_global())
Arguments
...
arguments passed to knit
options
a list of chunk options to be used as global options inside the child document (ignored if not a list); when we use the child option in a parent chunk, the chunk options of the parent chunk will be passed to the options argument
envir
the environment in which the code chunks are to be evaluated (for example, parent.frame(), new.env(), or globale
Value

• A character string of the content of the compiled child document is returned as a character string so it can be written back to the parent document directly.

Note

This function is not supposed be called directly like knit(); instead it must be placed in a parent document to let knit() call it indirectly.

The path of the child document is relative to the parent document.

References

http://yihui.name/knitr/demo/child/

• knit_child
Examples
# you can write \\Sexpr{knit_child('child-doc.Rnw')} in an Rnw file 'main.Rnw'
# to input results from child-doc.Rnw in main.tex

# comment out the child doc by \\Sexpr{knit_child('child-doc.Rnw', eval =
# FALSE)}
Documentation reproduced from package knitr, version 1.7, License: GPL

Community examples

Looks like there are no examples yet.