From 4cac887278e7d868bb3c8806eadc49c172434669 Mon Sep 17 00:00:00 2001 From: ecmerkle Date: Mon, 25 Mar 2024 12:58:58 -0500 Subject: [PATCH] ensure a group column exists in the partable --- DESCRIPTION | 2 +- R/blavaan.R | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c960ed42..3cd0c700 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: blavaan Title: Bayesian Latent Variable Analysis -Version: 0.5-3.1249 +Version: 0.5-3.1251 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 59ed1a19..672bebea 100644 --- a/R/blavaan.R +++ b/R/blavaan.R @@ -402,7 +402,10 @@ blavaan <- function(..., # default lavaan arguments LAV@ParTable$rhs %in% LAV@ParTable$plabel[cov.pars]) & LAV@ParTable$op == "==")) if(con.cov) LAV@Options$auto.cov.lv.x <- FALSE - + + # ensure group is in the parTable + if(!("group" %in% names(LAV@ParTable))) LAV@ParTable$group <- rep(1L, length(LAV@ParTable$lhs)) + # if std.lv, truncate the prior of each lv's first loading loadpt <- LAV@ParTable$op == "=~" lvs <- unique(LAV@ParTable$lhs[loadpt])