Skip to content

Commit

Permalink
fix issue with new R-devel
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-buerkner committed Sep 25, 2023
1 parent 4c80415 commit ca12a94
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Package: brms
Encoding: UTF-8
Type: Package
Title: Bayesian Regression Models using 'Stan'
Version: 2.20.3
Date: 2023-09-14
Version: 2.20.4
Date: 2023-09-25
Authors@R:
c(person("Paul-Christian", "Bürkner", email = "paul.buerkner@gmail.com",
role = c("aut", "cre")),
Expand Down
2 changes: 1 addition & 1 deletion R/conditional_effects.R
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ get_all_effects.mvbrmsterms <- function(x, ...) {
# excludes all 3-way or higher interactions
#' @export
get_all_effects.brmsterms <- function(x, rsv_vars = NULL, comb_all = FALSE, ...) {
stopifnot(is.atomic(rsv_vars))
stopifnot(is_atomic_or_null(rsv_vars))
out <- list()
for (dp in names(x$dpars)) {
out <- c(out, get_all_effects(x$dpars[[dp]]))
Expand Down
2 changes: 1 addition & 1 deletion R/data-predictor.R
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ data_special_prior <- function(bterms, data, prior, ranef, sdata = NULL) {
# For details see ?stats::model.matrix
get_model_matrix <- function(formula, data = environment(formula),
cols2remove = NULL, rename = TRUE, ...) {
stopifnot(is.atomic(cols2remove))
stopifnot(is_atomic_or_null(cols2remove))
terms <- validate_terms(formula)
if (is.null(terms)) {
return(NULL)
Expand Down
4 changes: 4 additions & 0 deletions R/misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ first_not_null <- function(...) {
out
}

is_atomic_or_null <- function(x) {
is.atomic(x) || is.null(x)
}

isNA <- function(x) {
length(x) == 1L && is.na(x)
}
Expand Down

0 comments on commit ca12a94

Please sign in to comment.