diff --git a/rstan/rstan/R/stan_csv.R b/rstan/rstan/R/stan_csv.R index d3d678cf3..857044f0f 100644 --- a/rstan/rstan/R/stan_csv.R +++ b/rstan/rstan/R/stan_csv.R @@ -107,10 +107,11 @@ parse_stancsv_comments <- function(comments) { } names1 <- intersect(c("thin", "iter", "warmup", "chain_id", "max_depth", "num_samples", "num_warmup", "id", - "max_treedepth", "save_warmup"), names0) + "max_treedepth"), names0) names2 <- intersect(c("stepsize", "stepsize_jitter", "adapt_gamma", "adapt_kappa", "adapt_delta", "gamma", "kappa", "delta", "t0", "adapt_t0"), names0) + if ("save_warmup" %in% names(values)) values[["save_warmup"]] <- as.integer(as.logical(values[["save_warmup"]])) for (z in names1) values[[z]] <- as.integer(values[[z]]) for (z in names2) values[[z]] <- as.numeric(values[[z]]) if (compute_iter) values[["iter"]] <- values[["iter"]] + values[["warmup"]]