michaelhallquist / MplusAutomation

The MplusAutomation package leverages the flexibility of the R language to automate latent variable model estimation and interpretation using Mplus, a powerful latent variable modeling program developed by Muthen and Muthen (www.statmodel.com). Specifically, MplusAutomation provides routines for creating related groups of models, running batches of models, and extracting and tabulating model parameters and fit statistics.
81 stars 46 forks source link

warning message on is.na(columnNames) || is.null(columnNames) #171

Closed beib closed 1 year ago

beib commented 2 years ago

Following warning message is shown despite models running fine.

Warning message: In is.na(columnNames) || is.null(columnNames) : 'length(x) = 7 > 1' in coercion to 'logical(1)'

michaelhallquist commented 2 years ago

Hi there,

Would you please upload a reproducible example? We need the .out file for readModels and the R code you used to produce the warning above.

Thanks, Michael

sda030 commented 1 year ago

Issue arises in extracting modindices. No modindices element in the output. (I believed it was always present before?)

library(lavaan)
library(MplusAutomation)
tmp <- lavaan::simulateData(model = "f =~ x1 + 1.2*x2 + .8*x3 + .9*x4 + 1.1*x5")
x <- mplusObject(rdata = tmp, MODEL = "f by x1-x5;", OUTPUT = "MOD(ALL);")
x <- mplusModeler(x, modelout = "tmp.inp", run = 1L)
#> Warning in is.na(columnNames) || is.null(columnNames): 'length(x) = 7 > 1' in
#> coercion to 'logical(1)'

Created on 2022-07-17 by the reprex package (v2.0.1)

haozhou1988 commented 1 year ago

@michaelhallquist probably because of the highlighted part of extractModIndices_1 function. See the attachment 1663221027872