From 805057abd06aa113afd83b4560ff321fd39d14c7 Mon Sep 17 00:00:00 2001 From: ecmerkle Date: Wed, 11 Sep 2024 09:34:36 -0500 Subject: [PATCH] call bsam stan model differently, to avoid "stanmodels" clashes --- DESCRIPTION | 2 +- R/blavaan.R | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 86e169dc..8c141dd9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 = "merklee@missouri.edu", diff --git a/R/blavaan.R b/R/blavaan.R index 7bae4a5c..a217b698 100644 --- a/R/blavaan.R +++ b/R/blavaan.R @@ -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) } @@ -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))