diff --git a/DESCRIPTION b/DESCRIPTION index abe9316..ac9107c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: modelbpp Title: Model BIC Posterior Probability -Version: 0.1.3.5 +Version: 0.1.3.6 Authors@R: c(person(given = "Shu Fai", family = "Cheung", diff --git a/NEWS.md b/NEWS.md index 8fb6978..05ea70e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# modelbpp 0.1.3.5 +# modelbpp 0.1.3.6 ## New Features @@ -34,6 +34,10 @@ Short names should now be properly constructed. (0.1.3.3) +- Fixed a bug in `print.model_set()` + about the printing of additional fit + measures. (0.1.3.6) + # modelbpp 0.1.3 ## New Features diff --git a/R/print.model_set.R b/R/print.model_set.R index 77a3bb4..bb11e9c 100644 --- a/R/print.model_set.R +++ b/R/print.model_set.R @@ -157,7 +157,15 @@ print.model_set <- function(x, out_table$Prior <- prior_tmp out_table$BIC <- bic_tmp out_table$BPP <- postprob_tmp - + if (!is.null(more_fit_measures)) { + # TODO: Handle nonconvergence + fit_fm <- sapply(x$fit, + lavaan::fitMeasures, + fit.measures = more_fit_measures, + output = "vector") + fit_fm <- t(fit_fm) + out_table <- cbind(out_table, fit_fm) + } if (sort_models && models_fitted && all_converged) { i <- order(out_table$BPP, decreasing = TRUE) @@ -168,15 +176,6 @@ print.model_set <- function(x, format = "f") out_table["Cumulative"] <- tmp } - if (!is.null(more_fit_measures)) { - # TODO: Handle nonconvergence - fit_fm <- sapply(x$fit, - lavaan::fitMeasures, - fit.measures = more_fit_measures, - output = "vector") - fit_fm <- t(fit_fm) - out_table <- cbind(out_table, fit_fm) - } out_table_print <- out_table out_table_print$Prior <- round(out_table_print$Prior, digits = bpp_digits) diff --git a/README.md b/README.md index 0ed59f9..25ebf0d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ # modelbpp: Model BIC Posterior Probability -(Version 0.1.3.5 updated on 2024-04-07, [release history](https://sfcheung.github.io/modelbpp/news/index.html)) +(Version 0.1.3.6 updated on 2024-04-07, [release history](https://sfcheung.github.io/modelbpp/news/index.html)) This package is for assessing model uncertainty in structural equation modeling (SEM) by the BIC posterior