Skip to content

Commit f38d063

Browse files
committed
size -> linewidth in a few more places
1 parent 0d3b5da commit f38d063

File tree

8 files changed

+19
-18
lines changed

8 files changed

+19
-18
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ import(rlang)
188188
import(stats)
189189
importFrom(dplyr,"%>%")
190190
importFrom(dplyr,across)
191+
importFrom(dplyr,all_of)
191192
importFrom(dplyr,arrange)
192193
importFrom(dplyr,count)
193194
importFrom(dplyr,full_join)

R/bayesplot-colors.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ plot_scheme <- function(scheme = NULL) {
226226
width = .5,
227227
stat = "identity",
228228
color = "white",
229-
size = 0.1
229+
linewidth = 0.1
230230
) +
231231
scale_fill_manual("", values = unlist(x)) +
232232
theme_void() +

R/mcmc-diagnostics-nuts.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ mcmc_nuts_energy <-
457457
fill = ~ "Ediff_fill",
458458
color = ~ "Ediff_fill"
459459
),
460-
size = 0.25,
460+
linewidth = 0.25,
461461
na.rm = TRUE,
462462
binwidth = binwidth
463463
) +
@@ -467,7 +467,7 @@ mcmc_nuts_energy <-
467467
fill = ~ "E_fill",
468468
color = ~ "E_fill"
469469
),
470-
size = 0.25,
470+
linewidth = 0.25,
471471
na.rm = TRUE,
472472
alpha = alpha,
473473
binwidth = binwidth

R/mcmc-intervals.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ mcmc_intervals <- function(x,
213213

214214
# faint vertical line at zero if zero is within x_lim
215215
layer_vertical_line <- if (0 > x_lim[1] && 0 < x_lim[2]) {
216-
vline_0(color = "gray90", size = 0.5)
216+
vline_0(color = "gray90", linewidth = 0.5)
217217
} else {
218218
geom_ignore()
219219
}
@@ -275,7 +275,7 @@ mcmc_intervals <- function(x,
275275
legend_move(ifelse(color_by_rhat, "top", "none")) +
276276
yaxis_text(face = "bold") +
277277
yaxis_title(FALSE) +
278-
yaxis_ticks(size = 1) +
278+
yaxis_ticks(linewidth = 1) +
279279
xaxis_title(FALSE)
280280
}
281281

R/ppc-discrete.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ ppc_bars_data <-
366366
#' @param y,yrep,group User's already validated `y`, `yrep`, and (if applicable)
367367
#' `group` arguments.
368368
#' @param prob,freq User's `prob` and `freq` arguments.
369-
#' @importFrom dplyr "%>%" ungroup count arrange mutate summarise across full_join rename
369+
#' @importFrom dplyr "%>%" ungroup count arrange mutate summarise across full_join rename all_of
370370
.ppc_bars_data <- function(y, yrep, group = NULL, prob = 0.9, freq = TRUE) {
371371
alpha <- (1 - prob) / 2
372372
probs <- sort(c(alpha, 0.5, 1 - alpha))
@@ -401,7 +401,7 @@ ppc_bars_data <-
401401

402402
yrep_summary <- data %>%
403403
dplyr::filter(!.data$variable == "y") %>%
404-
summarise(across(summary_var, summary_funs, .names = "{.fn}")) %>%
404+
summarise(across(all_of(summary_var), summary_funs, .names = "{.fn}")) %>%
405405
ungroup() %>%
406406
arrange(.data$group, .data$value)
407407

R/ppc-test-statistics.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ ppc_stat <-
124124
geom_histogram(
125125
aes_(fill = "yrep"),
126126
color = get_color("lh"),
127-
size = .25,
127+
linewidth = 0.25,
128128
na.rm = TRUE,
129129
binwidth = binwidth,
130130
breaks = breaks
131131
) +
132132
geom_vline(
133133
data = dplyr::filter(data, .data$variable == "y"),
134134
mapping = aes_(xintercept = ~ value, color = "y"),
135-
size = 1.5
135+
linewidth = 1.5
136136
) +
137137
scale_color_ppc(values = get_color("dh"), labels = Ty_label()) +
138138
scale_fill_ppc(values = get_color("l"), labels = Tyrep_label()) +
@@ -204,15 +204,15 @@ ppc_stat_freqpoly <-
204204
) +
205205
geom_freqpoly(
206206
aes_(color = "yrep"),
207-
size = .5,
207+
linewidth = 0.5,
208208
na.rm = TRUE,
209209
binwidth = binwidth
210210
) +
211211
geom_vline(
212212
data = dplyr::filter(data, .data$variable == "y"),
213213
mapping = aes_(xintercept = ~ value, color = "y"),
214214
show.legend = FALSE,
215-
size = 1
215+
linewidth = 1
216216
) +
217217
scale_color_ppc(
218218
name = stat_legend_title(stat, deparse(substitute(stat))),
@@ -307,7 +307,7 @@ ppc_stat_2d <- function(y,
307307
color = "y"
308308
),
309309
linetype = 2,
310-
size = 0.4,
310+
linewidth = 0.4,
311311
show.legend = FALSE
312312
) +
313313
geom_point(

R/ppd-test-statistics.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ ppd_stat <-
5656
fill = "ypred"
5757
)) +
5858
geom_histogram(
59-
size = .25,
59+
linewidth = 0.25,
6060
na.rm = TRUE,
6161
binwidth = binwidth,
6262
breaks = breaks
@@ -118,7 +118,7 @@ ppd_stat_freqpoly <-
118118
ggplot(data, mapping = set_hist_aes(freq)) +
119119
geom_freqpoly(
120120
aes_(color = "ypred"),
121-
size = .5,
121+
linewidth = 0.5,
122122
na.rm = TRUE,
123123
binwidth = binwidth
124124
) +

tests/testthat/test-convenience-functions.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,15 @@ test_that("yaxis_title returns correct theme object", {
163163
test_that("xaxis_ticks returns correct theme object", {
164164
expect_identical(xaxis_ticks(FALSE), theme(axis.ticks.x = element_blank()))
165165
expect_equal(
166-
xaxis_ticks(size = 0.5, color = "red"),
167-
theme(axis.ticks.x = element_line(size = 0.5, color = "red"))
166+
xaxis_ticks(linewidth = 0.5, color = "red"),
167+
theme(axis.ticks.x = element_line(linewidth = 0.5, color = "red"))
168168
)
169169
})
170170
test_that("yaxis_ticks returns correct theme object", {
171171
expect_identical(yaxis_ticks(FALSE), theme(axis.ticks.y = element_blank()))
172172
expect_equal(
173-
yaxis_ticks(size = 0.5, color = "red"),
174-
theme(axis.ticks.y = element_line(size = 0.5, color = "red"))
173+
yaxis_ticks(linewidth = 0.5, color = "red"),
174+
theme(axis.ticks.y = element_line(linewidth = 0.5, color = "red"))
175175
)
176176
})
177177

0 commit comments

Comments
 (0)