Skip to content

Commit

Permalink
Fix coef$max_var condition
Browse files Browse the repository at this point in the history
  • Loading branch information
franzmohr committed Jun 10, 2023
1 parent 32b56bf commit d5f7a09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/add_priors.gvarsubmodels.R
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ add_priors.gvarsubmodels <- function(object, ...,

# Restrict prior variances
if (!is.null(coef[["max_var"]])) {
if (any(stats::na.omit(V) > coef[["max_var"]])) {
if (any(stats::na.omit(c(V)) > coef[["max_var"]])) {
V[which(V > coef[["max_var"]])] <- coef[["max_var"]]
}
}
Expand Down
2 changes: 1 addition & 1 deletion R/add_priors.gvecsubmodels.R
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ add_priors.gvecsubmodels <- function(object, ...,

# Restrict prior variances
if (!is.null(coef[["max_var"]])) {
if (any(stats::na.omit(V) > coef[["max_var"]])) {
if (any(stats::na.omit(c(V)) > coef[["max_var"]])) {
V[which(V > coef[["max_var"]])] <- coef[["max_var"]]
}
}
Expand Down

0 comments on commit d5f7a09

Please sign in to comment.