diff --git a/DESCRIPTION b/DESCRIPTION index aead763dd..8f12403ad 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: see Title: Model Visualisation Toolbox for 'easystats' and 'ggplot2' -Version: 0.9.0 +Version: 0.9.0.1 Authors@R: c(person(given = "Daniel", family = "Lüdecke", diff --git a/NEWS.md b/NEWS.md index bf61ca065..d0c299923 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +# see (development) + +## Changes + +- `plot()` for `p_function()` now checks the values of the `size_length` + argument, to give an informative error message when the input is not valid. + # see 0.9.0 ## Changes diff --git a/R/plot.p_function.R b/R/plot.p_function.R index e6f4e3a5e..878fe08d1 100644 --- a/R/plot.p_function.R +++ b/R/plot.p_function.R @@ -55,6 +55,12 @@ plot.see_p_function <- function(x, # make sure group is factor data_ci_segments$group <- as.factor(data_ci_segments$group) + # sanity check - size_line must be of length two, when we have more than + # one group (i.e. when we emphasize CI lines) + if (length(size_line) != 2 && insight::n_unique(data_ci_segments$group) == 2) { + insight::format_error("Length of `size_line` must of length 2, to match regular and emphasized interval lines.") # nolint + } + # setup - no color/fill aes for ribbons when we have no facets if (!is.null(n_columns) || insight::n_unique(data_ribbon$Parameter) == 1) { p <- ggplot2::ggplot() + diff --git a/vignettes/parameters.Rmd b/vignettes/parameters.Rmd index aea10eb81..ad1c8e545 100644 --- a/vignettes/parameters.Rmd +++ b/vignettes/parameters.Rmd @@ -426,7 +426,7 @@ result <- p_function(model) plot(result) result <- p_function(model, ci_levels = c(0.5, 0.7, emph = 0.9)) -plot(result, size_line = 0.6, 1.0) +plot(result, size_line = c(0.6, 1.2)) ``` ## Principal Component Analysis