Skip to content

Commit

Permalink
stan: csv: Protect conditionals for save_warmup
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbadr committed Jul 20, 2024
1 parent 34279a7 commit fc414f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rstan/rstan/R/stan_csv.R
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ read_stan_csv <- function(csvfiles, col_major = TRUE) {

n_kept0 <- 1 + (iter - warmup - 1) %/% thin
warmup2 <- 0
if (max(save_warmup) == 0L) { # all equal to 0L
if (isTRUE(max(save_warmup) == 0L)) { # all equal to 0L
n_kept <- n_save
} else if (min(save_warmup) == 1L) { # all equals to 1L
} else if (isTRUE(min(save_warmup) == 1L)) { # all equals to 1L
warmup2 <- 1 + (warmup[1] - 1) %/% thin[1]
n_kept <- n_save - warmup2
}
Expand Down

0 comments on commit fc414f9

Please sign in to comment.