R/lists.R

Defines functions semPlotModel.list

Documented in semPlotModel.list

semPlotModel.list <- function(object,...)
{
  if ("mplus.model"%in%class(object)) return(semPlotModel.mplus.model(object,...))
  
  mod <- try(semPlotModel_lavaanModel(object,...),silent=TRUE)
  if (!"try-error"%in%class(mod)) return(mod)
  
  isModel <- sapply(object,function(x)"semPlotModel"%in%class(x))
  object[!isModel] <- lapply(object[!isModel],semPlotModel)
  if (length(object)>1) 
  {
    Res <- object[[1]]
    for (i in 2:length(object)) Res <- Res + object[[i]]
    return(Res) 
  } else return(object)
}

Try the semPlot package in your browser

Any scripts or data that you put into this service are public.

semPlot documentation built on Aug. 10, 2022, 9:06 a.m.