Skip to content

Commit bb6e71e

Browse files
CRAN release 0.7.5 (#271)
* Update DESCRIPTION * avoid circular devel version dependency * suppress package startups * fix example * minor * use fornat_alerts * line length lints * bump insight * run tests in parallel * avoid generic names * Create check-random-test-order.yaml * fix tests * add a global skip for tests * extract out commonly used model * bump version --------- Co-authored-by: Daniel <mail@danielluedecke.de>
1 parent 1abb493 commit bb6e71e

37 files changed

Lines changed: 255 additions & 113 deletions
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Run tests in random order
2+
on:
3+
push:
4+
branches: [main, master]
5+
pull_request:
6+
branches: [main, master]
7+
8+
name: check-random-test-order
9+
10+
jobs:
11+
check-random-test-order:
12+
uses: easystats/workflows/.github/workflows/check-random-test-order.yaml@main

DESCRIPTION

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: see
33
Title: Model Visualisation Toolbox for 'easystats' and 'ggplot2'
4-
Version: 0.7.4.3
4+
Version: 0.7.5
55
Authors@R:
66
c(person(given = "Daniel",
77
family = "Lüdecke",
@@ -63,20 +63,15 @@ Depends:
6363
R (>= 3.6),
6464
stats
6565
Imports:
66-
bayestestR (>= 0.13.0.6),
67-
correlation (>= 0.8.3.1),
68-
datawizard (>= 0.6.4),
66+
bayestestR (>= 0.13.0),
67+
correlation (>= 0.8.3),
68+
datawizard (>= 0.7.0),
6969
effectsize (>= 0.8.3),
70-
ggplot2 (>= 3.4.0),
71-
insight (>= 0.19.0),
70+
ggplot2 (>= 3.4.1),
71+
insight (>= 0.19.1),
7272
modelbased (>= 0.8.5),
73-
parameters (>= 0.20.0),
73+
parameters (>= 0.20.2),
7474
performance (>= 0.10.1)
75-
Remotes:
76-
easystats/insight,
77-
easystats/parameters,
78-
easystats/correlation,
79-
easystats/bayestestR
8075
Suggests:
8176
brms,
8277
curl,
@@ -109,14 +104,15 @@ Suggests:
109104
rstanarm,
110105
scales (>= 1.2.1),
111106
splines,
112-
testthat (>= 3.1.6),
107+
testthat (>= 3.1.7),
113108
tidygraph,
114109
vdiffr (>= 1.0.5)
115110
Encoding: UTF-8
116111
Language: en-US
117112
Roxygen: list(markdown = TRUE)
118113
RoxygenNote: 7.2.3.9000
119114
Config/testthat/edition: 3
115+
Config/testthat/parallel: true
120116
Config/Needs/website:
121117
rstudio/bslib,
122118
r-lib/pkgdown,

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# see (development version)
1+
# see 0.7.5
22

33
## Changes
44

R/plot.hdi.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ data_plot.bayestestR_eti <- data_plot.hdi
150150

151151
# normalize
152152
out$height <- as.vector((out$height - min(out$height, na.rm = TRUE)) / diff(range(out$height, na.rm = TRUE), na.rm = TRUE))
153+
153154
out
154155
}
155156

@@ -215,8 +216,8 @@ plot.see_hdi <- function(x,
215216
}
216217

217218
# check if we have multiple panels
218-
if ((!"Effects" %in% names(x) || length(unique(x$Effects)) <= 1) &&
219-
(!"Component" %in% names(x) || length(unique(x$Component)) <= 1)) {
219+
if ((!"Effects" %in% names(x) || length(unique(x$Effects)) <= 1L) &&
220+
(!"Component" %in% names(x) || length(unique(x$Component)) <= 1L)) {
220221
n_columns <- NULL
221222
}
222223

R/plot.performance_roc.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ plot.see_performance_roc <- function(x, ...) {
3737
x,
3838
aes(
3939
x = .data$Specificity,
40-
y = .data$Sensitivity,
40+
y = .data$Sensitivity
4141
)
4242
)
4343
}

R/plots.R

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#' Multiple plots side by side
22
#'
33
#' A wrapper around *patchwork* to plot multiple figures side by side on
4-
#' the same page. See
5-
#' [the
6-
#' *patchwork* documentation](https://patchwork.data-imaginist.com/articles/patchwork.html) for more advanced control of plot layouts.
4+
#' the same page. See [the *patchwork* documentation](https://patchwork.data-imaginist.com/articles/patchwork.html)
5+
#' for more advanced control of plot layouts.
76
#'
87
#' @param ... Multiple `ggplot`s or a list containing `ggplot` objects
98
#' @param n_rows Number of rows to align plots.
@@ -99,20 +98,14 @@ plots <- function(...,
9998
pw_drawn <- tryCatch(print(pw), error = function(e) e)
10099
if (inherits(pw_drawn, "simpleError")) {
101100
if (Sys.getenv("RSTUDIO") == "1") {
102-
stop(
103-
insight::format_message(
104-
"The RStudio 'Plots' window is too small to show this set of plots.",
105-
"Please make the window larger."
106-
),
107-
call. = FALSE
101+
insight::format_error(
102+
"The RStudio 'Plots' window is too small to show this set of plots.",
103+
"Please make the window larger."
108104
)
109105
} else {
110-
stop(
111-
insight::format_message(
112-
"The viewport is too small to show this set of plots.",
113-
"Please make it larger."
114-
),
115-
call. = FALSE
106+
insight::format_error(
107+
"The viewport is too small to show this set of plots.",
108+
"Please make it larger."
116109
)
117110
}
118111
}

R/scale_color_bluebrown.R

Lines changed: 61 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,34 @@ scale_color_bluebrown <- function(palette = "contrast", discrete = TRUE, reverse
3333

3434
#' @rdname scale_color_bluebrown
3535
#' @export
36-
scale_color_bluebrown_d <- function(palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "color", ...) {
37-
scale_color_bluebrown(palette = palette, discrete = discrete, reverse = reverse, aesthetics = aesthetics, ...)
36+
scale_color_bluebrown_d <- function(palette = "contrast",
37+
discrete = TRUE,
38+
reverse = FALSE,
39+
aesthetics = "color",
40+
...) {
41+
scale_color_bluebrown(
42+
palette = palette,
43+
discrete = discrete,
44+
reverse = reverse,
45+
aesthetics = aesthetics,
46+
...
47+
)
3848
}
3949

4050
#' @rdname scale_color_bluebrown
4151
#' @export
42-
scale_color_bluebrown_c <- function(palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "color", ...) {
43-
scale_color_bluebrown(palette = palette, discrete = discrete, reverse = reverse, aesthetics = aesthetics, ...)
52+
scale_color_bluebrown_c <- function(palette = "contrast",
53+
discrete = FALSE,
54+
reverse = FALSE,
55+
aesthetics = "color",
56+
...) {
57+
scale_color_bluebrown(
58+
palette = palette,
59+
discrete = discrete,
60+
reverse = reverse,
61+
aesthetics = aesthetics,
62+
...
63+
)
4464
}
4565

4666
#' @rdname scale_color_bluebrown
@@ -65,11 +85,20 @@ scale_colour_bluebrown_d <- scale_color_bluebrown_d
6585

6686
#' @rdname scale_color_bluebrown
6787
#' @export
68-
scale_fill_bluebrown <- function(palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ...) {
88+
scale_fill_bluebrown <- function(palette = "contrast",
89+
discrete = TRUE,
90+
reverse = FALSE,
91+
aesthetics = "fill",
92+
...) {
6993
pal <- palette_bluebrown(palette = palette, reverse = reverse)
7094

7195
if (discrete) {
72-
discrete_scale(aesthetics = aesthetics, paste0("bluebrown_", palette), palette = pal, ...)
96+
discrete_scale(
97+
aesthetics = aesthetics,
98+
paste0("bluebrown_", palette),
99+
palette = pal,
100+
...
101+
)
73102
} else {
74103
scale_fill_gradientn(colours = pal(256), aesthetics = aesthetics, ...)
75104
}
@@ -78,14 +107,34 @@ scale_fill_bluebrown <- function(palette = "contrast", discrete = TRUE, reverse
78107

79108
#' @rdname scale_color_bluebrown
80109
#' @export
81-
scale_fill_bluebrown_d <- function(palette = "contrast", discrete = TRUE, reverse = FALSE, aesthetics = "fill", ...) {
82-
scale_fill_bluebrown(palette = palette, discrete = discrete, reverse = reverse, aesthetics = aesthetics, ...)
110+
scale_fill_bluebrown_d <- function(palette = "contrast",
111+
discrete = TRUE,
112+
reverse = FALSE,
113+
aesthetics = "fill",
114+
...) {
115+
scale_fill_bluebrown(
116+
palette = palette,
117+
discrete = discrete,
118+
reverse = reverse,
119+
aesthetics = aesthetics,
120+
...
121+
)
83122
}
84123

85124
#' @rdname scale_color_bluebrown
86125
#' @export
87-
scale_fill_bluebrown_c <- function(palette = "contrast", discrete = FALSE, reverse = FALSE, aesthetics = "fill", ...) {
88-
scale_fill_bluebrown(palette = palette, discrete = discrete, reverse = reverse, aesthetics = aesthetics, ...)
126+
scale_fill_bluebrown_c <- function(palette = "contrast",
127+
discrete = FALSE,
128+
reverse = FALSE,
129+
aesthetics = "fill",
130+
...) {
131+
scale_fill_bluebrown(
132+
palette = palette,
133+
discrete = discrete,
134+
reverse = reverse,
135+
aesthetics = aesthetics,
136+
...
137+
)
89138
}
90139

91140

@@ -110,7 +159,8 @@ bluebrown_colors_list <- c(
110159

111160
#' Extract blue-brown colors as hex codes
112161
#'
113-
#' Can be used to get the hex code of specific colors from the blue-brown color palette. Use `bluebrown_colors()` to see all available colors.
162+
#' Can be used to get the hex code of specific colors from the blue-brown color palette.
163+
#' Use `bluebrown_colors()` to see all available colors.
114164
#'
115165
#' @inheritParams flat_colors
116166
#'

R/scale_color_material.R

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,33 @@ material_colors <- function(...) {
210210
material_palettes <- list(
211211
`full` = material_colors(),
212212
`ice` = material_colors("purple", "deep purple", "indigo", "blue", "light blue"),
213-
`rainbow` = material_colors("purple", "deep purple", "indigo", "blue", "light blue", "green", "light green", "lime", "amber", "orange", "deep orange", "red", "pink"),
213+
`rainbow` = material_colors(
214+
"purple",
215+
"deep purple",
216+
"indigo",
217+
"blue",
218+
"light blue",
219+
"green",
220+
"light green",
221+
"lime",
222+
"amber",
223+
"orange",
224+
"deep orange",
225+
"red",
226+
"pink"
227+
),
214228
`contrast` = material_colors("blue", "green", "amber", "purple", "red"),
215229
`light` = material_colors("light blue", "pink", "yellow", "light green", "orange"),
216-
`complement` = material_colors("blue", "blue grey", "teal", "green", "light green", "yellow", "amber", "red")
230+
`complement` = material_colors(
231+
"blue",
232+
"blue grey",
233+
"teal",
234+
"green",
235+
"light green",
236+
"yellow",
237+
"amber",
238+
"red"
239+
)
217240
)
218241

219242

R/scale_color_okabeito.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ palette_okabeito <- function(palette = "full_amber", reverse = FALSE, order = 1:
203203
datawizard::text_concatenate(names(okabeito_palettes), last = " or ", enclose = "`"),
204204
"."
205205
), "Using default palette now.")
206-
warning(insight::format_message(msg), call. = FALSE)
206+
insight::format_warning(msg)
207207
palette <- "full"
208208
}
209209

@@ -219,11 +219,11 @@ palette_okabeito <- function(palette = "full_amber", reverse = FALSE, order = 1:
219219

220220
function(n) {
221221
if (n > length(pal)) {
222-
warning(insight::format_message(
222+
insight::format_warning(
223223
"The number of colors requested `n` is too large.",
224224
paste0("The maximum number of colors is ", length(pal), "."),
225225
paste0("Returning a palette with ", length(pal), " colors.")
226-
))
226+
)
227227
n <- length(pal)
228228
}
229229
unname(pal[seq_len(n)])

R/scale_color_see.R

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,30 @@ see_colors <- function(...) {
198198
see_palettes <- list(
199199
`full` = see_colors(),
200200
`ice` = see_colors("indigo", "blue", "blue grey", "cyan", "light blue"),
201-
`rainbow` = see_colors("purple", "deep purple", "indigo", "blue", "light blue", "green", "light green", "lime", "amber", "orange", "red", "pink"),
201+
`rainbow` = see_colors(
202+
"purple",
203+
"deep purple",
204+
"indigo",
205+
"blue",
206+
"light blue",
207+
"green",
208+
"light green",
209+
"lime",
210+
"amber",
211+
"orange",
212+
"red",
213+
"pink"
214+
),
202215
`contrast` = see_colors("blue", "orange", "yellow", "green", "red"),
203-
`complement` = see_colors("blue", "blue grey", "green", "light green", "yellow", "amber", "red"),
216+
`complement` = see_colors(
217+
"blue",
218+
"blue grey",
219+
"green",
220+
"light green",
221+
"yellow",
222+
"amber",
223+
"red"
224+
),
204225
`light` = see_colors("light blue", "pink", "lime", "light green", "orange")
205226
)
206227

@@ -230,7 +251,7 @@ palette_see <- function(palette = "contrast", reverse = FALSE, ...) {
230251
datawizard::text_concatenate(names(palette_list), last = " or ", enclose = "`"),
231252
"."
232253
), "Using default palette now.")
233-
warning(insight::format_message(msg), call. = FALSE)
254+
insight::format_warning(msg)
234255
palette <- 1
235256
}
236257
pal <- palette_list[[palette]]

0 commit comments

Comments
 (0)