lavaan_rerun_check {semfindr} | R Documentation |
Compatibility Check for 'lavaan_rerun'
Description
Gets a 'lavaan' output and checks whether it is
supported by lavaan_rerun()
.
Usage
lavaan_rerun_check(fit, print_messages = TRUE)
Arguments
fit |
The output from |
print_messages |
Logical. If |
Details
This function is not supposed to be used by users. It is
called by lavaan_rerun()
to see if the analysis being passed to
it is supported. If not, messages will be printed to indicate why.
Value
A single-element vector. If confirmed to be supported, will return 0. If not confirmed be support but may still work, return 1. If confirmed to be not yet supported, will return a negative number, the value of this number without the negative sign is the number of tests failed.
Author(s)
Shu Fai Cheung https://orcid.org/0000-0002-9871-9448.
Examples
dat <- cfa_dat
mod <-
"
f1 =~ x4 + x5 + x6
"
dat_gp <- dat
dat$gp <- rep(c("gp1", "gp2"), length.out = nrow(dat_gp))
fit01 <- lavaan::sem(mod, dat)
# If supported, returns a zero.
lavaan_rerun_check(fit01)
fit05 <- lavaan::cfa(mod, dat, group = "gp")
# If not supported, returns a negative number.
lavaan_rerun_check(fit05)