Skip to content

Commit

Permalink
CRAN RC: 0.8.3 (#332)
Browse files Browse the repository at this point in the history
* CRAN RC: 0.8.3

* update snapshots

* suppress stan glm messages

* Update WORDLIST

* no need to run examples conditional on hard deps

* another one

* add test for ROC function

* slightly increase point size

* update snapshots

* get rid of warnings about deprecated arg

* fix example

* fix remaining examples

* fix example

* another example to fix

* fix example

* fix example

* downgrade ggplot2 version

---------

Co-authored-by: Daniel <[email protected]>
  • Loading branch information
IndrajeetPatil and strengejacke authored Mar 24, 2024
1 parent 222c024 commit 1f50306
Show file tree
Hide file tree
Showing 37 changed files with 143 additions and 84 deletions.
11 changes: 5 additions & 6 deletions 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.8.2.7
Version: 0.8.3
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down Expand Up @@ -67,11 +67,11 @@ Imports:
correlation (>= 0.8.4),
datawizard (>= 0.9.1),
effectsize (>= 0.8.6),
ggplot2 (>= 3.4.0),
insight (>= 0.19.8),
ggplot2 (>= 3.4.4),
insight (>= 0.19.10),
modelbased (>= 0.8.7),
parameters (>= 0.21.5),
performance (>= 0.10.9)
parameters (>= 0.21.6),
performance (>= 0.11.0)
Suggests:
brms,
curl,
Expand Down Expand Up @@ -119,4 +119,3 @@ Config/Needs/website:
r-lib/pkgdown,
easystats/easystatstemplate
Config/rcmdcheck/ignore-inconsequential-notes: true
Remotes: easystats/performance
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# see (development version)
# see 0.8.3

## Major changes

Expand Down
6 changes: 4 additions & 2 deletions R/coord_radar.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
#' @inheritParams ggplot2::coord_polar
#' @param ... Other arguments to be passed to `ggproto`.
#'
#' @examplesIf require("datawizard") && require("ggplot2")
#' @examples
#' library(ggplot2)
#'
#' # Create a radar/spider chart with ggplot:
#' data(iris)
#' data <- aggregate(iris[-5], list(Species = iris$Species), mean)
#' data <- data_to_long(
#' data <- datawizard::data_to_long(
#' data,
#' c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width")
#' )
Expand Down
4 changes: 2 additions & 2 deletions R/data_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ data_plot <- function(x, ...) {
#' model <- suppressWarnings(stan_glm(
#' Sepal.Length ~ Petal.Width + Species + Sepal.Width,
#' data = iris,
#' chains = 2, iter = 200
#' chains = 2, iter = 200, refresh = 0
#' ))
#'
#' result <- hdi(model, ci = c(0.5, 0.75, 0.9, 0.95))
#' result <- bayestestR::hdi(model, ci = c(0.5, 0.75, 0.9, 0.95))
#' data <- data_plot(result, data = model)
#'
#' p <- ggplot(
Expand Down
4 changes: 2 additions & 2 deletions R/plot.check_heteroscedasticity.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#'
#' @seealso See also the vignette about [`check_model()`](https://easystats.github.io/performance/articles/check_model.html).

Check warning on line 10 in R/plot.check_heteroscedasticity.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/plot.check_heteroscedasticity.R,line=10,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 125 characters.
#'
#' @examplesIf require("performance")
#' @examples
#' m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
#' result <- check_heteroscedasticity(m)
#' result <- performance::check_heteroscedasticity(m)
#' result
#' plot(result, data = m) # data required for pkgdown
#' @export
Expand Down
4 changes: 3 additions & 1 deletion R/plot.check_homogeneity.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#'
#' @return A ggplot2-object.
#'
#' @examplesIf require("performance")
#' @examples
#' library(performance)
#'
#' model <<- lm(len ~ supp + dose, data = ToothGrowth)
#' result <- check_homogeneity(model)
#' result
Expand Down
5 changes: 3 additions & 2 deletions R/plot.check_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
#'
#' @seealso See also the vignette about [`check_model()`](https://easystats.github.io/performance/articles/check_model.html).

Check warning on line 12 in R/plot.check_model.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/plot.check_model.R,line=12,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 125 characters.
#'
#' @examplesIf require("performance") && require("patchwork")
#' @examplesIf require("patchwork")
#' library(performance)
#'
#' model <- lm(qsec ~ drat + wt, data = mtcars)
#' plot(check_model(model))
#'
Expand Down Expand Up @@ -177,7 +179,6 @@ plot.see_check_model <- function(x,
colors = colors,
detrend = detrend,
style = style

)
} else {
p$QQ <- .plot_diag_qq(
Expand Down
8 changes: 5 additions & 3 deletions R/plot.check_normality.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,22 @@
#'
#' @seealso See also the vignette about [`check_model()`](https://easystats.github.io/performance/articles/check_model.html).

Check warning on line 27 in R/plot.check_normality.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/plot.check_normality.R,line=27,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 125 characters.
#'
#' @examplesIf require("performance")
#' @examples
#' library(performance)
#'
#' m <<- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
#' result <- check_normality(m)
#' plot(result)
#'
#' @examplesIf require("performance") && require("qqplotr")
#' @examplesIf require("qqplotr")
#' plot(result, type = "qq", detrend = TRUE)
#'
#' @export
plot.see_check_normality <- function(x,
type = c("qq", "pp", "density"),
data = NULL,
size_line = 0.8,
size_point = 1.5,
size_point = 2,
alpha = 0.2,
dot_alpha = 0.8,
colors = c("#3aaf85", "#1b6ca8"),
Expand Down
4 changes: 3 additions & 1 deletion R/plot.check_predictions.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ data_plot.performance_pp_check <- function(x, type = "density", ...) {
#'
#' @seealso See also the vignette about [`check_model()`](https://easystats.github.io/performance/articles/check_model.html).

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

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/plot.check_predictions.R,line=56,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 125 characters.
#'
#' @examplesIf require("performance")
#' @examples
#' library(performance)
#'
#' model <- lm(Sepal.Length ~ Species * Petal.Width + Petal.Length, data = iris)
#' check_predictions(model)
#'
Expand Down
4 changes: 2 additions & 2 deletions R/plot.compare_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
#'
#' @return A ggplot2-object.
#'
#' @examplesIf require("insight") && require("parameters")
#' @examples
#' data(iris)
#' lm1 <- lm(Sepal.Length ~ Species, data = iris)
#' lm2 <- lm(Sepal.Length ~ Species + Petal.Length, data = iris)
#' lm3 <- lm(Sepal.Length ~ Species * Petal.Length, data = iris)
#' result <- compare_parameters(lm1, lm2, lm3)
#' result <- parameters::compare_parameters(lm1, lm2, lm3)
#' plot(result)
#' @export
plot.see_compare_parameters <- function(x,

Check warning on line 25 in R/plot.compare_parameters.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/plot.compare_parameters.R,line=25,col=1,[cyclocomp_linter] Reduce the cyclomatic complexity of this function from 43 to at most 40.
Expand Down
4 changes: 3 additions & 1 deletion R/plot.estimate_contrasts.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ data_plot.estimate_contrasts <- function(x, data = NULL, ...) {
#'
#' @return A ggplot2-object.
#'
#' @examplesIf require("modelbased") && require("emmeans")
#' @examplesIf require("emmeans")
#' \donttest{
#' library(modelbased)
#'
#' model <- lm(Sepal.Width ~ Species, data = iris)
#' contrasts <- estimate_contrasts(model)
#' means <- estimate_means(model)
Expand Down
4 changes: 2 additions & 2 deletions R/plot.n_factors.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ data_plot.n_clusters <- data_plot.n_factors
#'
#' @return A ggplot2-object.
#'
#' @examplesIf require("parameters") && require("nFactors")
#' @examplesIf require("nFactors")
#' data(mtcars)
#' result <- n_factors(mtcars, type = "PCA")
#' result <- parameters::n_factors(mtcars, type = "PCA")
#' result
#'
#' plot(result) # type = "bar" by default
Expand Down
2 changes: 1 addition & 1 deletion R/plot.parameters_brms_meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ data_plot.parameters_brms_meta <- function(x, data = NULL, normalize_height = TR
#' prior(cauchy(0, 0.5), class = sd)
#' )
#' model <- suppressWarnings(
#' brm(yi | se(vi) ~ 1 + (1 | author), data = dat)
#' brm(yi | se(vi) ~ 1 + (1 | author), data = dat, refresh = 0, silent = 2)
#' )
#'
#' # result
Expand Down
2 changes: 1 addition & 1 deletion R/plot.performance_simres.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#' @export
plot.see_performance_simres <- function(x,
size_line = 0.8,
size_point = 1.5,
size_point = 2,
alpha = 0.2,
dot_alpha = 0.8,
colors = c("#3aaf85", "#1b6ca8"),
Expand Down
11 changes: 2 additions & 9 deletions R/scale_color_bluebrown.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ scale_color_bluebrown <- function(palette = "contrast", discrete = TRUE, reverse
pal <- palette_bluebrown(palette = palette, reverse = reverse)

if (discrete) {
discrete_scale(aesthetics = aesthetics, paste0("bluebrown_", palette), palette = pal, ...)
discrete_scale(aesthetics = aesthetics, palette = pal, ...)
} else {
scale_color_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
}
Expand Down Expand Up @@ -93,12 +93,7 @@ scale_fill_bluebrown <- function(palette = "contrast",
pal <- palette_bluebrown(palette = palette, reverse = reverse)

if (discrete) {
discrete_scale(
aesthetics = aesthetics,
paste0("bluebrown_", palette),
palette = pal,
...
)
discrete_scale(aesthetics = aesthetics, palette = pal, ...)
} else {
scale_fill_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
}
Expand Down Expand Up @@ -144,8 +139,6 @@ scale_fill_bluebrown_c <- function(palette = "contrast",
# Palette --------------------------------------------------------------------




bluebrown_colors_list <- c(
`lightblue` = "#6DC0E0",
`blue` = "#5B93AE",
Expand Down
8 changes: 1 addition & 7 deletions R/scale_color_colorhex.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ scale_color_colorhex <- function(palette = 1014416,
if (discrete) {
discrete_scale(
aesthetics = aesthetics,
scale_name = paste0("colorhex_", pal_name),
palette = pal,
...
)
Expand Down Expand Up @@ -126,12 +125,7 @@ scale_fill_colorhex <- function(palette = 1014416,
pal <- palette_colorhex(palette = palette, reverse = reverse)

if (discrete) {
discrete_scale(
aesthetics = aesthetics,
paste0("colorhex_", palette),
palette = pal,
...
)
discrete_scale(aesthetics = aesthetics, palette = pal, ...)
} else {
scale_fill_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
}
Expand Down
4 changes: 2 additions & 2 deletions R/scale_color_flat.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ scale_color_flat <- function(palette = "contrast",
pal <- palette_flat(palette = palette, reverse = reverse)

if (discrete) {
discrete_scale(aesthetics = aesthetics, paste0("flat_", palette), palette = pal, ...)
discrete_scale(aesthetics = aesthetics, palette = pal, ...)
} else {
scale_color_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
}
Expand Down Expand Up @@ -111,7 +111,7 @@ scale_fill_flat <- function(palette = "contrast",
pal <- palette_flat(palette = palette, reverse = reverse)

if (discrete) {
discrete_scale(aesthetics = aesthetics, paste0("flat_", palette), palette = pal, ...)
discrete_scale(aesthetics = aesthetics, palette = pal, ...)
} else {
scale_fill_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
}
Expand Down
4 changes: 2 additions & 2 deletions R/scale_color_material.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ scale_color_material <- function(palette = "contrast",
pal <- palette_material(palette = palette, reverse = reverse)

if (discrete) {
discrete_scale(aesthetics = aesthetics, paste0("material_", palette), palette = pal, ...)
discrete_scale(aesthetics = aesthetics, palette = pal, ...)
} else {
scale_color_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
}
Expand Down Expand Up @@ -108,7 +108,7 @@ scale_fill_material <- function(palette = "contrast",
pal <- palette_material(palette = palette, reverse = reverse)

if (discrete) {
discrete_scale(aesthetics = aesthetics, paste0("material_", palette), palette = pal, ...)
discrete_scale(aesthetics = aesthetics, palette = pal, ...)
} else {
scale_fill_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
}
Expand Down
4 changes: 2 additions & 2 deletions R/scale_color_metro.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ scale_color_metro <- function(palette = "complement",
pal <- palette_metro(palette = palette, reverse = reverse)

if (discrete) {
discrete_scale(aesthetics = aesthetics, paste0("metro_", palette), palette = pal, ...)
discrete_scale(aesthetics = aesthetics, palette = pal, ...)
} else {
scale_color_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
}
Expand Down Expand Up @@ -108,7 +108,7 @@ scale_fill_metro <- function(palette = "complement",
pal <- palette_metro(palette = palette, reverse = reverse)

if (discrete) {
discrete_scale(aesthetics = aesthetics, paste0("metro_", palette), palette = pal, ...)
discrete_scale(aesthetics = aesthetics, palette = pal, ...)
} else {
scale_fill_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
}
Expand Down
2 changes: 0 additions & 2 deletions R/scale_color_okabeito.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
scale_color_okabeito <- function(palette = "full", reverse = FALSE, order = 1:9, aesthetics = "color", ...) {
discrete_scale(
aesthetics = aesthetics,
paste0("okabeito_", palette),
palette = palette_okabeito(palette = palette, reverse = reverse, order = order),
...
)
Expand All @@ -73,7 +72,6 @@ scale_color_okabeito <- function(palette = "full", reverse = FALSE, order = 1:9,
scale_fill_okabeito <- function(palette = "full", reverse = FALSE, order = 1:9, aesthetics = "fill", ...) {
discrete_scale(
aesthetics = aesthetics,
paste0("okabeito_", palette),
palette = palette_okabeito(palette = palette, reverse = reverse, order = order),
...
)
Expand Down
4 changes: 2 additions & 2 deletions R/scale_color_pizza.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ scale_color_pizza <- function(palette = "margherita",
pal <- palette_pizza(palette = palette, reverse = reverse)

if (discrete) {
discrete_scale(aesthetics = aesthetics, paste0("pizza_", palette), palette = pal, ...)
discrete_scale(aesthetics = aesthetics, palette = pal, ...)
} else {
scale_color_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
}
Expand Down Expand Up @@ -100,7 +100,7 @@ scale_fill_pizza <- function(palette = "margherita",
pal <- palette_pizza(palette = palette, reverse = reverse)

if (discrete) {
discrete_scale(aesthetics = aesthetics, paste0("pizza_", palette), palette = pal, ...)
discrete_scale(aesthetics = aesthetics, palette = pal, ...)
} else {
scale_fill_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
}
Expand Down
4 changes: 2 additions & 2 deletions R/scale_color_see.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ scale_color_see <- function(palette = "contrast",
pal <- palette_see(palette = palette, reverse = reverse)

if (discrete) {
discrete_scale(aesthetics = aesthetics, paste0("see_", palette), palette = pal, ...)
discrete_scale(aesthetics = aesthetics, palette = pal, ...)
} else {
scale_color_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
}
Expand Down Expand Up @@ -106,7 +106,7 @@ scale_fill_see <- function(palette = "contrast",
pal <- palette_see(palette = palette, reverse = reverse)

if (discrete) {
discrete_scale(aesthetics = aesthetics, paste0("see_", palette), palette = pal, ...)
discrete_scale(aesthetics = aesthetics, palette = pal, ...)
} else {
scale_fill_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
}
Expand Down
4 changes: 2 additions & 2 deletions R/scale_color_social.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ scale_color_social <- function(palette = "complement", discrete = TRUE, reverse
pal <- palette_social(palette = palette, reverse = reverse)

if (discrete) {
discrete_scale(aesthetics = aesthetics, paste0("social_", palette), palette = pal, ...)
discrete_scale(aesthetics = aesthetics, palette = pal, ...)
} else {
scale_color_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
}
Expand Down Expand Up @@ -79,7 +79,7 @@ scale_fill_social <- function(palette = "complement", discrete = TRUE, reverse =
pal <- palette_social(palette = palette, reverse = reverse)

if (discrete) {
discrete_scale(aesthetics = aesthetics, paste0("social_", palette), palette = pal, ...)
discrete_scale(aesthetics = aesthetics, palette = pal, ...)
} else {
scale_fill_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
}
Expand Down
4 changes: 2 additions & 2 deletions man/add_plot_attributes.Rd

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

Loading

0 comments on commit 1f50306

Please sign in to comment.