Skip to content

Commit

Permalink
call bsam stan model differently, to avoid "stanmodels" clashes
Browse files Browse the repository at this point in the history
  • Loading branch information
ecmerkle committed Sep 11, 2024
1 parent d2586d1 commit 805057a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: blavaan
Title: Bayesian Latent Variable Analysis
Version: 0.5-6.1306
Version: 0.5-6.1307
Authors@R: c(person(given = "Edgar", family = "Merkle",
role = c("aut", "cre"),
email = "[email protected]",
Expand Down
4 changes: 2 additions & 2 deletions R/blavaan.R
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ blavaan <- function(..., # default lavaan arguments
fnm <- paste0(jagdir, "/sem.", fext)
if(target %in% c("stan", "cmdstan")){
if(mcmcextra$dosam){
cat(bsam::stanmodels$stanmarg_bsam@model_code, file = fnm)
cat(getFromNamespace("stanmodels", "bsam")$stanmarg_bsam@model_code, file = fnm)
} else {
cat(stanmodels$stanmarg@model_code, file = fnm)
}
Expand Down Expand Up @@ -726,7 +726,7 @@ blavaan <- function(..., # default lavaan arguments
} else if(target == "cmdstan"){
rjarg <- with(jagtrans, list(data = data, init = inits))
} else if(mcmcextra$dosam){
rjarg <- with(jagtrans, list(object = bsam::stanmodels$stanmarg_bsam,
rjarg <- with(jagtrans, list(object = getFromNamespace("stanmodels", "bsam")$stanmarg_bsam,
data = data,
pars = sampparms,
init = inits))
Expand Down

0 comments on commit 805057a

Please sign in to comment.