Skip to content

Commit

Permalink
styler
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jun 29, 2023
1 parent e5d811b commit 57b9db8
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions R/unupdate.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,17 @@ unupdate.brmsfit_multiple <- function(model,
insight::format_alert("Sampling priors, please wait...")
}

utils::capture.output({model_prior <-
try(suppressMessages(suppressWarnings(
stats::update(
model,
sample_prior = "only",
newdata = newdata,
refresh = 0
)
)), silent = TRUE)})
utils::capture.output({
model_prior <-
try(suppressMessages(suppressWarnings(
stats::update(
model,
sample_prior = "only",
newdata = newdata,
refresh = 0
)
)), silent = TRUE)
})

if (methods::is(model_prior, "try-error")) {
if (grepl("proper priors", model_prior, fixed = TRUE)) {
Expand Down Expand Up @@ -143,7 +145,9 @@ unupdate.blavaan <- function(model, verbose = TRUE, ...) {

cl$prisamp <- TRUE
suppressMessages(suppressWarnings(
utils::capture.output({model_prior <- eval(cl)})
utils::capture.output({
model_prior <- eval(cl)
})
))

model_prior
Expand Down

0 comments on commit 57b9db8

Please sign in to comment.