Skip to contents

This provides a knitr engine for Stan, suitable for usage when attempting to render Stan chunks and compile the model code within to an executable with CmdStan. Use register_knitr_engine() to make this the default engine for stan chunks. See the vignette R Markdown CmdStan Engine for an example.

Usage

eng_cmdstan(options)

Arguments

options

(named list) Chunk options supplied by knitr. The output.var element is required and must be a single character string naming the CmdStanModel object created by the chunk.

Value

A character vector containing the formatted chunk output produced by knitr::engine_output().

Examples

# \dontrun{
knitr::knit_engines$set(stan = cmdstanr::eng_cmdstan)
# }