From 5dd30f2498c9cdfe8cc6bb8448e6043df86a1089 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 26 Mar 2024 11:54:23 +0100 Subject: [PATCH] base font size --- DESCRIPTION | 2 +- NEWS.md | 4 ++++ R/check_model.R | 9 +++++++++ man/check_model.Rd | 3 +++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9060334f5..7ff8da559 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: performance Title: Assessment of Regression Models Performance -Version: 0.11.0 +Version: 0.11.0.1 Authors@R: c(person(given = "Daniel", family = "Lüdecke", diff --git a/NEWS.md b/NEWS.md index 1ff9ab142..9f1572292 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# performance 0.11.1 + +* `check_model()` gets a `base_size` argument, to set the base font size for plots. + # performance 0.11.0 ## New supported models diff --git a/R/check_model.R b/R/check_model.R index cf33f3eef..d075fe5cb 100644 --- a/R/check_model.R +++ b/R/check_model.R @@ -9,6 +9,7 @@ #' #' @param x A model object. #' @param dot_size,line_size Size of line and dot-geoms. +#' @param base_size Base font size for plots. #' @param panel Logical, if `TRUE`, plots are arranged as panels; else, #' single plots for each diagnostic are returned. #' @param check Character vector, indicating which checks for should be performed @@ -191,6 +192,7 @@ check_model.default <- function(x, dot_alpha = 0.8, colors = c("#3aaf85", "#1b6ca8", "#cd201f"), theme = "see::theme_lucid", + base_size = 10, detrend = TRUE, show_dots = NULL, bandwidth = "nrd", @@ -261,6 +263,7 @@ check_model.default <- function(x, attr(assumptions_data, "panel") <- panel attr(assumptions_data, "dot_size") <- dot_size attr(assumptions_data, "line_size") <- line_size + attr(assumptions_data, "base_size") <- base_size attr(assumptions_data, "check") <- check attr(assumptions_data, "alpha") <- alpha attr(assumptions_data, "dot_alpha") <- dot_alpha @@ -308,6 +311,7 @@ check_model.stanreg <- function(x, dot_alpha = 0.8, colors = c("#3aaf85", "#1b6ca8", "#cd201f"), theme = "see::theme_lucid", + base_size = 10, detrend = TRUE, show_dots = NULL, bandwidth = "nrd", @@ -324,6 +328,7 @@ check_model.stanreg <- function(x, dot_alpha = dot_alpha, colors = colors, theme = theme, + base_size = base_size, detrend = detrend, show_dots = show_dots, bandwidth = bandwidth, @@ -349,6 +354,7 @@ check_model.model_fit <- function(x, dot_alpha = 0.8, colors = c("#3aaf85", "#1b6ca8", "#cd201f"), theme = "see::theme_lucid", + base_size = 10, detrend = TRUE, show_dots = NULL, bandwidth = "nrd", @@ -366,6 +372,7 @@ check_model.model_fit <- function(x, dot_alpha = dot_alpha, colors = colors, theme = theme, + base_size = base_size, detrend = detrend, show_dots = show_dots, bandwidth = bandwidth, @@ -387,6 +394,7 @@ check_model.performance_simres <- function(x, dot_alpha = 0.8, colors = c("#3aaf85", "#1b6ca8", "#cd201f"), theme = "see::theme_lucid", + base_size = 10, detrend = TRUE, show_dots = NULL, bandwidth = "nrd", @@ -404,6 +412,7 @@ check_model.performance_simres <- function(x, dot_alpha = dot_alpha, colors = colors, theme = theme, + base_size = base_size, detrend = detrend, show_dots = show_dots, bandwidth = bandwidth, diff --git a/man/check_model.Rd b/man/check_model.Rd index d0d7e765b..3c90b67b9 100644 --- a/man/check_model.Rd +++ b/man/check_model.Rd @@ -17,6 +17,7 @@ check_model(x, ...) dot_alpha = 0.8, colors = c("#3aaf85", "#1b6ca8", "#cd201f"), theme = "see::theme_lucid", + base_size = 10, detrend = TRUE, show_dots = NULL, bandwidth = "nrd", @@ -57,6 +58,8 @@ for dots, and third color for outliers or extreme values.} \item{theme}{String, indicating the name of the plot-theme. Must be in the format \code{"package::theme_name"} (e.g. \code{"ggplot2::theme_minimal"}).} +\item{base_size}{Base font size for plots.} + \item{detrend}{Logical. Should Q-Q/P-P plots be detrended? Defaults to \code{TRUE} for linear models or when \code{residual_type = "normal"}. Defaults to \code{FALSE} for QQ plots based on simulated residuals (i.e. when