Skip to content

Commit 63a1768

Browse files
committed
ifelse fix
1 parent 39c2f4f commit 63a1768

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

R/model.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,8 +1149,8 @@ sample <- function(data = NULL,
11491149
show_messages = TRUE,
11501150
show_exceptions = TRUE,
11511151
diagnostics = c("divergences", "treedepth", "ebfmi"),
1152-
save_metric = ifelse(cmdstan_version() > "2.34.0", TRUE, NULL),
1153-
save_cmdstan_config = ifelse(cmdstan_version() > "2.34.0", TRUE, NULL),
1152+
save_metric = if (cmdstan_version() > "2.34.0") { TRUE } else { NULL },
1153+
save_cmdstan_config = if (cmdstan_version() > "2.34.0") { TRUE } else { NULL },
11541154
# deprecated
11551155
cores = NULL,
11561156
num_cores = NULL,
@@ -1361,7 +1361,7 @@ sample_mpi <- function(data = NULL,
13611361
show_messages = TRUE,
13621362
show_exceptions = TRUE,
13631363
diagnostics = c("divergences", "treedepth", "ebfmi"),
1364-
save_cmdstan_config = ifelse(cmdstan_version() > "2.34.0", TRUE, NULL),
1364+
save_cmdstan_config = if (cmdstan_version() > "2.34.0") { TRUE } else { NULL },
13651365
# deprecated
13661366
validate_csv = TRUE) {
13671367

@@ -1507,7 +1507,7 @@ optimize <- function(data = NULL,
15071507
history_size = NULL,
15081508
show_messages = TRUE,
15091509
show_exceptions = TRUE,
1510-
save_cmdstan_config = ifelse(cmdstan_version() > "2.34.0", TRUE, NULL)) {
1510+
save_cmdstan_config = if (cmdstan_version() > "2.34.0") { TRUE } else { NULL }) {
15111511
procs <- CmdStanProcs$new(
15121512
num_procs = 1,
15131513
show_stderr_messages = show_exceptions,
@@ -1641,7 +1641,7 @@ laplace <- function(data = NULL,
16411641
draws = NULL,
16421642
show_messages = TRUE,
16431643
show_exceptions = TRUE,
1644-
save_cmdstan_config = ifelse(cmdstan_version() > "2.34.0", TRUE, NULL)) {
1644+
save_cmdstan_config = if (cmdstan_version() > "2.34.0") { TRUE } else { NULL }) {
16451645
if (cmdstan_version() < "2.32") {
16461646
stop("This method is only available in cmdstan >= 2.32", call. = FALSE)
16471647
}
@@ -1797,7 +1797,7 @@ variational <- function(data = NULL,
17971797
draws = NULL,
17981798
show_messages = TRUE,
17991799
show_exceptions = TRUE,
1800-
save_cmdstan_config = ifelse(cmdstan_version() > "2.34.0", TRUE, NULL)) {
1800+
save_cmdstan_config = if (cmdstan_version() > "2.34.0") { TRUE } else { NULL }) {
18011801
procs <- CmdStanProcs$new(
18021802
num_procs = 1,
18031803
show_stderr_messages = show_exceptions,
@@ -1942,7 +1942,7 @@ pathfinder <- function(data = NULL,
19421942
calculate_lp = NULL,
19431943
show_messages = TRUE,
19441944
show_exceptions = TRUE,
1945-
save_cmdstan_config = ifelse(cmdstan_version() > "2.34.0", TRUE, NULL)) {
1945+
save_cmdstan_config = if (cmdstan_version() > "2.34.0") { TRUE } else { NULL }) {
19461946
procs <- CmdStanProcs$new(
19471947
num_procs = 1,
19481948
show_stderr_messages = show_exceptions,

0 commit comments

Comments
 (0)