stan_cite() generates the correct citations for Stan packages
in a directory or set of files. The {knitr} package is required
to parse Quarto (.qmd) or RMarkdown (.Rmd) documents. stan_cite()
uses some simple heuristics to guess which packages export functions,
and also attempts to map re-exports to their origin package. Calls
to library(), require(), requireNamespace(), or use() are
all recognized as attaching a package.
Arguments
- path
A single project directory (searched recursively) or a vector of files (.R/.Rmd/.qmd).
- strict
If
TRUE(default), only count unqualified function calls that resolve to a single Stan package.- format
One of "bibtex" or "bibentry", specifying the return format.
- skip_dirs
Defaults to directories listed in
scan_skip_dirs. Character vector of directory names to skip when scanning a directory.- ignore_unqualified_functions
Defaults to exports from base R packages listed in
stdlib_funs(). Character vector of function names to ignore when attributing (unqualified) calls to Stan packages. Calls likerstan::plot()will NOT be ignored even ifplotis inignore_unqualified_functions, since they are namespaced.- quiet
Logical. If
TRUE, suppresses status messages.
Details
The parsing is handled by scan_usage(); stan_cite() owns
the citation lookups.