Skip to content

Commit 6c27ed7

Browse files
authored
Merge pull request #26 from stemangiola/main
Allow instantiate to build cmdstanr-based packages without install as source
2 parents bf1c8cf + 3e24acd commit 6c27ed7

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Description: Similar to 'rstantools' for 'rstan',
1111
migrate from 'rstan' to the more modern 'cmdstanr'.
1212
Packages 'rstantools', 'cmdstanr', 'stannis', and
1313
'stanapi' are similar Stan clients with different objectives.
14-
Version: 0.2.2.9000
14+
Version: 0.2.2.9001
1515
License: MIT + file LICENSE
1616
URL: https://wlandau.github.io/instantiate/,
1717
https://github.com/wlandau/instantiate

R/stan_package_model.R

+10-2
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,21 @@
2020
#' @param library Character of length 1 or `NULL`, library path
2121
#' to look for the package with the built-in Stan model.
2222
#' Passed to the `lib.loc` argument of `system.file()`.
23+
#' @param compile `TRUE` to compile the model and store the executable file
24+
#' where the package is installed in `.libpaths()`. `FALSE` to
25+
#' skip compilation and assume the model is already compiled,
26+
#' which is usually the case.
27+
#' @param ... Arguments passed to cmdstanr("cmdstan_model").
2328
#' @examples
2429
#' # Please see the documentation website of the {instantiate} package
2530
#' # for examples.
2631
stan_package_model <- function(
2732
name,
2833
package,
2934
library = NULL,
30-
cmdstan_install = Sys.getenv("CMDSTAN_INSTALL", unset = "")
35+
cmdstan_install = Sys.getenv("CMDSTAN_INSTALL", unset = ""),
36+
compile = FALSE,
37+
...
3138
) {
3239
stan_assert_cmdstanr()
3340
stan_assert(name, is.character(.), !anyNA(.), nzchar(.))
@@ -71,6 +78,7 @@ stan_package_model <- function(
7178
cmdstanr("cmdstan_model")(
7279
stan_file = stan_file,
7380
exe_file = exe_file,
74-
compile = FALSE
81+
compile = compile,
82+
...
7583
)
7684
}

0 commit comments

Comments
 (0)