Skip to content

Commit f2d92c1

Browse files
committed
add argument to limit dots
1 parent 321d1f4 commit f2d92c1

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: performance
33
Title: Assessment of Regression Models Performance
4-
Version: 0.15.3.2
4+
Version: 0.15.3.3
55
Authors@R:
66
c(person(given = "Daniel",
77
family = "Lüdecke",

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# performance (devel)
22

3+
## Changes
4+
5+
* `check_model()` now limits the number of data points for models with many
6+
observations, to reduce the time for rendering the plot via the `maximum_dots`
7+
argument.
8+
39
## Bug fixes
410

511
* Fixed issue in `check_dag()` with multiple colliders.

R/check_model.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
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",

man/check_model.Rd

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)