4747# ' time-consuming. By default, `show_dots = NULL`. In this case `check_model()`
4848# ' tries to guess whether performance will be poor due to a very large model
4949# ' and thus automatically shows or hides dots.
50+ # ' @param maximum_dots Limits the number of data points for models with many
51+ # ' observations, to reduce the time for rendering the plot. Defaults to a
52+ # ' maximum of 2000 data points to render
5053# ' @param verbose If `FALSE` (default), suppress most warning messages.
5154# ' @param ... Arguments passed down to the individual check functions, especially
5255# ' to `check_predictions()` and `binned_residuals()`.
@@ -203,6 +206,7 @@ check_model.default <- function(
203206 type = " density" ,
204207 residual_type = NULL ,
205208 show_dots = NULL ,
209+ maximum_dots = 2000 ,
206210 size_dot = 2 ,
207211 size_line = 0.8 ,
208212 size_title = 12 ,
@@ -323,6 +327,7 @@ check_model.default <- function(
323327 attr(assumptions_data , " overdisp_type" ) <- list (... )$ plot_type
324328 attr(assumptions_data , " bandwidth" ) <- bandwidth
325329 attr(assumptions_data , " type" ) <- type
330+ attr(assumptions_data , " maximum_dots" ) <- maximum_dots
326331 attr(assumptions_data , " model_class" ) <- class(x )[1 ]
327332 assumptions_data
328333}
@@ -358,6 +363,7 @@ check_model.stanreg <- function(
358363 type = " density" ,
359364 residual_type = NULL ,
360365 show_dots = NULL ,
366+ maximum_dots = 2000 ,
361367 size_dot = 2 ,
362368 size_line = 0.8 ,
363369 size_title = 12 ,
@@ -387,6 +393,7 @@ check_model.stanreg <- function(
387393 bandwidth = bandwidth ,
388394 type = type ,
389395 residual_type = residual_type ,
396+ maximum_dots = maximum_dots ,
390397 verbose = verbose ,
391398 ...
392399 )
@@ -407,6 +414,7 @@ check_model.model_fit <- function(
407414 type = " density" ,
408415 residual_type = NULL ,
409416 show_dots = NULL ,
417+ maximum_dots = 2000 ,
410418 size_dot = 2 ,
411419 size_line = 0.8 ,
412420 size_title = 12 ,
@@ -433,6 +441,7 @@ check_model.model_fit <- function(
433441 base_size = base_size ,
434442 detrend = detrend ,
435443 show_dots = show_dots ,
444+ maximum_dots = maximum_dots ,
436445 bandwidth = bandwidth ,
437446 type = type ,
438447 residual_type = residual_type ,
@@ -452,6 +461,7 @@ check_model.performance_simres <- function(
452461 type = " density" ,
453462 residual_type = NULL ,
454463 show_dots = NULL ,
464+ maximum_dots = 2000 ,
455465 size_dot = 2 ,
456466 size_line = 0.8 ,
457467 size_title = 12 ,
@@ -478,6 +488,7 @@ check_model.performance_simres <- function(
478488 base_size = base_size ,
479489 detrend = detrend ,
480490 show_dots = show_dots ,
491+ maximum_dots = maximum_dots ,
481492 bandwidth = bandwidth ,
482493 type = type ,
483494 residual_type = " simulated" ,
0 commit comments