Skip to content

Commit d831b30

Browse files
authored
Merge pull request #414 from BjarkeHautop/fix-ggplot2-size-warning
Fix all `size` warnings calls to ggplot2 (deprecated at 3.4.0).
2 parents bb23eb3 + e2b62b9 commit d831b30

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

R/mcmc-traces.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ mcmc_rank_overlay <- function(x,
337337
geom_hline(
338338
yintercept = (right_edge / n_bins) / n_chains,
339339
color = get_color("dark_highlight"),
340-
size = 1,
340+
linewidth = 1,
341341
linetype = "dashed"
342342
)
343343
} else {
@@ -417,7 +417,7 @@ mcmc_rank_hist <- function(x,
417417
geom_hline(
418418
yintercept = (right_edge / n_bins) / n_chains,
419419
color = get_color("dark_highlight"),
420-
size = .5,
420+
linewidth = .5,
421421
linetype = "dashed"
422422
)
423423
} else {

R/ppc-censoring.R

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ NULL
9696
#' posterior predictive draws may not be shown by default because of the
9797
#' controlled extrapolation. To display all posterior predictive draws, set
9898
#' `extrapolation_factor = Inf`.
99-
#'
10099
ppc_km_overlay <- function(
101100
y,
102101
yrep,
@@ -173,7 +172,7 @@ ppc_km_overlay <- function(
173172
}
174173

175174
fsf$is_y_color <- as.factor(sub("\\[rep\\] \\(.*$", "rep", sub("^italic\\(y\\)", "y", fsf$strata)))
176-
fsf$is_y_size <- ifelse(fsf$is_y_color == "yrep", size, 1)
175+
fsf$is_y_linewidth <- ifelse(fsf$is_y_color == "yrep", size, 1)
177176
fsf$is_y_alpha <- ifelse(fsf$is_y_color == "yrep", alpha, 1)
178177

179178
max_time_y <- max(y, na.rm = TRUE)
@@ -189,7 +188,7 @@ ppc_km_overlay <- function(
189188
y = .data$surv,
190189
color = .data$is_y_color,
191190
group = .data$strata,
192-
size = .data$is_y_size,
191+
linewidth = .data$is_y_linewidth,
193192
alpha = .data$is_y_alpha)) +
194193
geom_step() +
195194
hline_at(
@@ -204,7 +203,7 @@ ppc_km_overlay <- function(
204203
linetype = 2,
205204
color = get_color("dh")
206205
) +
207-
scale_size_identity() +
206+
scale_linewidth_identity() +
208207
scale_alpha_identity() +
209208
scale_color_ppc() +
210209
scale_y_continuous(breaks = c(0, 0.5, 1)) +

R/ppc-discrete.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ ppc_rootogram <- function(y,
359359
if (style == "standing") {
360360
graph <- graph + dont_expand_y_axis()
361361
} else {
362-
graph <- graph + hline_0(size = 0.4)
362+
graph <- graph + hline_0(linewidth = 0.4)
363363
}
364364
}
365365

R/ppd-intervals.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ ppd_ribbon <-
162162
linewidth = 0.2 * size,
163163
alpha = 1
164164
) +
165-
geom_ribbon(size = 0.5 * size) +
165+
geom_ribbon(linewidth = 0.5 * size) +
166166
geom_line(
167167
mapping = aes(y = .data$m),
168168
color = get_color("d"),

0 commit comments

Comments
 (0)