Skip to content

Commit 51fb1cd

Browse files
committed
global max_rows option for print method
closes #469
1 parent 053a1ec commit 51fb1cd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

R/fit.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ CmdStanFit <- R6::R6Class(
1717
num_procs = function() {
1818
self$runset$num_procs()
1919
},
20-
print = function(variables = NULL, ..., digits = 2, max_rows = 10) {
20+
print = function(variables = NULL, ..., digits = 2, max_rows = getOption("cmdstanr_max_rows", 10)) {
2121
if (is.null(private$draws_) &&
2222
!length(self$output_files(include_failed = FALSE))) {
2323
stop("Fitting failed. Unable to print.", call. = FALSE)
@@ -54,7 +54,7 @@ CmdStanFit <- R6::R6Class(
5454
base::print(out, row.names = FALSE)
5555
if (max_rows < total_rows) {
5656
cat("\n # showing", max_rows, "of", total_rows,
57-
"rows (change via 'max_rows' argument)\n")
57+
"rows (change via 'max_rows' argument or 'cmdstanr_max_rows' option)\n")
5858
}
5959
invisible(self)
6060
}
@@ -706,7 +706,7 @@ CmdStanFit$set("public", name = "return_codes", value = return_codes)
706706
#'
707707
#' fit$profiles()
708708
#' }
709-
#'
709+
#'
710710
profiles <- function() {
711711
profiles <- list()
712712
i <- 1

vignettes/cmdstanr.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ fit <- mod$sample(
159159
data = data_list,
160160
seed = 123,
161161
chains = 4,
162-
parallel_chains = 2,
162+
parallel_chains = 4,
163163
refresh = 500
164164
)
165165
```

0 commit comments

Comments
 (0)