Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: see
Title: Model Visualisation Toolbox for 'easystats' and 'ggplot2'
Version: 0.14.1.1
Version: 0.14.1.2
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# see (devel)

## Breaking Changes
## Changes

* Argument `linewidth` was renamed to `size_line`, to be consistent across the
easystats-ecosystem.
easystats-ecosystem. However, `linewidth` remains as an alias, since this is
the name of the corresponding ggplot2-argument.

# see 0.14.1

Expand Down
5 changes: 5 additions & 0 deletions R/plot.binned_residuals.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ plot.see_binned_residuals <- function(
}
dots <- list(...)

# handle alias
if (!is.null(dots[["linewidth"]])) {
size_line <- dots[["linewidth"]]
}

# set defaults
term <- attr(x, "term", exact = TRUE)
if (is.null(dots[["show_dots"]])) {
Expand Down
6 changes: 6 additions & 0 deletions R/plot.check_collinearity.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ plot.see_check_collinearity <- function(
return(NULL)
}

# handle alias
dots <- list(...)
if (!is.null(dots[["linewidth"]])) {
size_line <- dots[["linewidth"]]
}

dat$group <- "low"
dat$group[dat$VIF >= 5 & dat$VIF < 10] <- "moderate"
dat$group[dat$VIF >= 10] <- "high"
Expand Down
6 changes: 6 additions & 0 deletions R/plot.check_heteroscedasticity.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ plot.see_check_heteroscedasticity <- function(
model <- data
}

# handle alias
dots <- list(...)
if (!is.null(dots[["linewidth"]])) {
size_line <- dots[["linewidth"]]
}

faminfo <- insight::model_info(model)
r <- tryCatch(
if (inherits(model, "merMod")) {
Expand Down
5 changes: 5 additions & 0 deletions R/plot.check_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ plot.see_check_model <- function(
show_dots <- .default_value(x, "show_dots", TRUE)
ppc_range <- .default_value(x, "ppc_range")

# handle alias
if (!is.null(dots[["linewidth"]])) {
size_line <- dots[["linewidth"]]
}

# Check for Confidence Intervals: Backwards compatibility for older package
# versions
show_ci <- !isFALSE(attr(x, "show_ci"))
Expand Down
9 changes: 8 additions & 1 deletion R/plot.check_normality.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#' Options are `"qq"` (default) for quantile-quantile (Q-Q) plots,
#' `"pp"` for probability-probability (P-P) plots, or
#' `"density"` for density overlay plots.
#' @param size_line Numeric value specifying size of line geoms.
#' @param size_line Numeric value specifying size of line geoms. `linewidth` is
#' an alias for `size_line`.
#' @param alpha_dot Numeric value specifying alpha level of the point geoms.
#' @param alpha Numeric value specifying alpha level of the confidence bands.
#' @param colors Character vector of length two, indicating the colors (in
Expand Down Expand Up @@ -65,6 +66,12 @@ plot.see_check_normality <- function(
model <- data
}

# handle alias
dots <- list(...)
if (!is.null(dots[["linewidth"]])) {
size_line <- dots[["linewidth"]]
}

# for GLM, only halfnormal Q-Q plots
if (inherits(model, "glm")) {
type <- "qq"
Expand Down
6 changes: 6 additions & 0 deletions R/plot.check_outliers.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ plot.see_check_outliers <- function(
# depending on the method
outlier_methods <- attr(x, "method", exact = TRUE)

# handle alias
dots <- list(...)
if (!is.null(dots[["linewidth"]])) {
size_line <- dots[["linewidth"]]
}

# validate that the method is correct
if (length(outlier_methods) == 0) {
insight::format_error(
Expand Down
6 changes: 6 additions & 0 deletions R/plot.check_overdisp.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ plot.see_check_overdisp <- function(
type = 1,
...
) {
# handle alias
dots <- list(...)
if (!is.null(dots[["linewidth"]])) {
size_line <- dots[["linewidth"]]
}

.plot_diag_overdispersion(
x,
theme = theme,
Expand Down
12 changes: 12 additions & 0 deletions R/plot.check_predictions.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@
orig_x <- x
check_range <- isTRUE(attributes(x)$check_range)

# handle alias
dots <- list(...)
if (!is.null(dots[["linewidth"]])) {
size_line <- dots[["linewidth"]]
}

p1 <- .prepare_pp_check(
x,
size_line = size_line,
Expand Down Expand Up @@ -181,6 +187,12 @@
x_limits <- .default_value(x, "x_limits", x_limits)
type <- .default_value(x, "type", type)

# handle alias
dots <- list(...)
if (!is.null(dots[["linewidth"]])) {
size_line <- dots[["linewidth"]]
}

p1 <- .prepare_pp_check(
x,
size_line = size_line,
Expand Down Expand Up @@ -286,7 +298,7 @@
base_size = 10,
size_axis_title = 10,
size_title = 12,
colors,

Check warning on line 301 in R/plot.check_predictions.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/plot.check_predictions.R,line=301,col=3,[function_argument_linter] Arguments without defaults should come before arguments with defaults.

Check warning on line 301 in R/plot.check_predictions.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/plot.check_predictions.R,line=301,col=3,[function_argument_linter] Arguments without defaults should come before arguments with defaults.
type = "density",
x_limits = NULL,
is_stan = NULL,
Expand Down
6 changes: 6 additions & 0 deletions R/plot.compare_performance.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ plot.see_compare_performance <- function(x, size_line = 1, ...) {
x <- data_plot(x)
}

# handle alias
dots <- list(...)
if (!is.null(dots[["linewidth"]])) {
size_line <- dots[["linewidth"]]
}

p <- ggplot2::ggplot(
x,
ggplot2::aes(
Expand Down
6 changes: 6 additions & 0 deletions R/plot.estimate_density.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Check for various problematic conditions with descriptive variables
is_parameter_empty <- length(dataplot$Parameter) == 0
is_parameter_all_na <- all(is.na(dataplot$Parameter))
has_parameter_all_empty_strings <- all(dataplot$Parameter == "")

Check warning on line 19 in R/plot.estimate_density.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/plot.estimate_density.R,line=19,col=44,[nzchar_linter] Use !nzchar(x) instead of x == "". Note that unlike nzchar(), EQ coerces to character, so you'll have to use as.character() if x is a factor. Whenever missing data is possible, please take care to use nzchar(., keepNA = TRUE); nzchar(NA) is TRUE by default.
has_parameter_no_unique_values <- length(unique(dataplot$Parameter[
!is.na(dataplot$Parameter)
])) ==
Expand Down Expand Up @@ -178,6 +178,12 @@
}
)

# handle alias
dots <- list(...)
if (!is.null(dots[["linewidth"]])) {
size_line <- dots[["linewidth"]]
}

if (!inherits(x, "data_plot")) {
x <- data_plot(x, data = model, centrality = centrality, ci = ci, ...)
}
Expand Down
6 changes: 6 additions & 0 deletions R/plot.p_function.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ plot.see_p_function <- function(
# data for vertical CI level lines
data_ci_segments <- x

# handle alias
dots <- list(...)
if (!is.null(dots[["linewidth"]])) {
size_line <- dots[["linewidth"]]
}
Comment on lines +47 to +51

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In plot.see_p_function, size_line is expected to be a vector of length 2 when there are multiple groups (to specify sizes for both regular and emphasized interval lines). If a user passes a single value via the linewidth alias (or size_line), it will trigger a sanity check error on line 75. Replicating size_line to length 2 when a single value is provided prevents this error and improves usability.

  # handle alias
  dots <- list(...)
  if (!is.null(dots[["linewidth"]])) {
    size_line <- dots[["linewidth"]]
  }
  if (length(size_line) == 1) {
    size_line <- rep(size_line, length.out = 2)
  }


# remove intercept?
data_ribbon <- .remove_intercept(data_ribbon, show_intercept = show_intercept)
data_ci_segments <- .remove_intercept(
Expand Down
6 changes: 6 additions & 0 deletions R/plot.parameters_brms_meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ plot.see_parameters_brms_meta <- function(
}
)

# handle alias
dots <- list(...)
if (!is.null(dots[["linewidth"]])) {
size_line <- dots[["linewidth"]]
}

if (!inherits(x, "data_plot")) {
x <- data_plot(x, data = model, normalize_height = normalize_height, ...)
}
Expand Down
7 changes: 7 additions & 0 deletions R/plot.parameters_simulate.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,17 @@ plot.see_parameters_simulate <- function(
) {
is_mlm <- !is.null(attributes(x)$object_class) &&
"mlm" %in% attributes(x)$object_class

if (is.null(n_columns) && (isTRUE(is_mlm) || "Response" %in% colnames(x))) {
n_columns <- 1
}

# handle alias
dots <- list(...)
if (!is.null(dots[["linewidth"]])) {
size_line <- dots[["linewidth"]]
}

# check for defaults
if (missing(centrality) && !is.null(attributes(x)$centrality)) {
centrality <- attributes(x)$centrality
Expand Down
6 changes: 6 additions & 0 deletions R/plot.performance_simres.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ plot.see_performance_simres <- function(
insight::check_if_installed("DHARMa")
qqplotr_installed <- insight::check_if_installed("qqplotr", quietly = TRUE)

# handle alias
dots <- list(...)
if (!is.null(dots[["linewidth"]])) {
size_line <- dots[["linewidth"]]
}

theme <- .set_default_theme(
x,
theme,
Expand Down
3 changes: 2 additions & 1 deletion man/plot.see_check_collinearity.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/plot.see_check_heteroscedasticity.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/plot.see_check_normality.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/plot.see_check_outliers.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/plot.see_compare_performance.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/plot.see_estimate_density.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/plot.see_p_function.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/plot.see_parameters_brms_meta.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/plot.see_parameters_simulate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/plot.see_performance_simres.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/print.see_performance_pp_check.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading