From 22a7126f42452648c29586b2142da6cdd8fe2be9 Mon Sep 17 00:00:00 2001 From: Andreas Brandmaier Date: Mon, 8 Apr 2024 10:37:52 +0200 Subject: [PATCH] added cstsem install test --- R/semtree.R | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/R/semtree.R b/R/semtree.R index c44c18d..513d230 100644 --- a/R/semtree.R +++ b/R/semtree.R @@ -171,6 +171,12 @@ semtree <- function(model, data = NULL, control = NULL, constraints = NULL, } else if ((inherits(model, "ctsemFit")) || (inherits(model, "ctsemInit"))) { # if (control$verbose) { ui_message("Detected ctsem model.") } control$sem.prog <- "ctsem" + + ctsemomx_omx_installed <- "ctsemOMX" %in% installed.packages()[,"Package"] + if (!ctsemomx_omx_installed) { + stop("Please install ctsemOMX first.") + } + } else { ui_stop("Unknown model type selected. Use OpenMx or lavaanified lavaan models!") }