# run_chunk

From knitr v0.9
0th

Percentile

##### Run the code in a specified chunk

We can specify a chunk label and use this function to evaluate the code in this chunk. It is an alternative to the chunk reference in Sweave.

##### Usage
run_chunk(label, envir = parent.frame())
##### Arguments
label
the chunk label
envir
the environment in which to evaluate the code
##### Details

The difference between this type of chunk reference and the chunk option ref.label is that the latter can only be used for a chunk so that it has exactly the same code as the reference chunk, whereas this function makes it possible to collect several little chunks and run them inside another big chunk.

##### Value

• Values returned by the code in the chunk.

##### Note

Recursion (must be finite, of course) of reference is allowed, e.g. we may run the code of chunk2 in chunk1, and chunk2 also contains a reference to chunk3, then if we run chunk1, both the code in chunk2 and chunk3 will be evaluated.

• run_chunk
##### Examples
# see http://yihui.name/knitr/demo/reference/
Documentation reproduced from package knitr, version 0.9, License: GPL

### Community examples

Looks like there are no examples yet.