diff --git a/R/add_priors.gvarsubmodels.R b/R/add_priors.gvarsubmodels.R index 6a2ce87..189e06c 100644 --- a/R/add_priors.gvarsubmodels.R +++ b/R/add_priors.gvarsubmodels.R @@ -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"]] } } diff --git a/R/add_priors.gvecsubmodels.R b/R/add_priors.gvecsubmodels.R index 39936ee..60fead8 100644 --- a/R/add_priors.gvecsubmodels.R +++ b/R/add_priors.gvecsubmodels.R @@ -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"]] } }