Skip to content

Commit

Permalink
replace deprecated facets argument in facet_grid()
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Jan 16, 2024
1 parent ce32ee0 commit 7a42e2b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/mcmc-diagnostics.R
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ drop_NAs_and_warn <- function(x) {
plot_data <- acf_data(x = x, lags = lags)

if (num_chains(x) > 1) {
facet_args$facets <- "Chain ~ Parameter"
facet_args$rows <- "Chain ~ Parameter"
facet_fun <- "facet_grid"
} else { # 1 chain
facet_args$facets <- "Parameter"
Expand Down
2 changes: 1 addition & 1 deletion R/mcmc-distributions.R
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ mcmc_violin <- function(
graph <- graph + do.call("facet_wrap", facet_args)
}
} else {
facet_args[["facets"]] <- if (n_param > 1) {
facet_args[["rows"]] <- if (n_param > 1) {
"Chain ~ Parameter"
} else {
"Chain ~ ."
Expand Down
1 change: 1 addition & 0 deletions R/mcmc-traces.R
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ mcmc_rank_hist <- function(x,
# Otherwise, use a grid.
if (n_param > 1) {
facet_f <- facet_grid
names(facet_args)[names(facet_args) == "facets"] <- "rows"
} else {
facet_f <- facet_wrap
facet_args[["nrow"]] <- facet_args[["nrow"]] %||% 1
Expand Down
2 changes: 1 addition & 1 deletion R/ppc-errors.R
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ error_hist_facets <-

if (grouped) {
facet_fun <- "facet_grid"
facet_args[["facets"]] <- rep_id ~ group
facet_args[["rows"]] <- rep_id ~ group
} else {
facet_fun <- "facet_wrap"
facet_args[["facets"]] <- ~ rep_id
Expand Down

0 comments on commit 7a42e2b

Please sign in to comment.