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

readModels return Warning message: In length(covcoverageSubsections) == 0 || is.na(covcoverageSubsections) : 'length(x) = 4 > 1' in coercion to 'logical(1)' #177

Closed haozhou1988 closed 1 year ago

haozhou1988 commented 1 year ago

fit <- MplusAutomation::readModels(“mplus1001.out”, recursive = T) It returns warnings. 1663123775411 mplus1001.txt

haozhou1988 commented 1 year ago

I think the reason is that R 4.20 changes the if ( ) rules. see the link: https://stackoverflow.com/a/72848495

cjvanlissa commented 1 year ago

@michaelhallquist @JWiley I pushed a fix and did a cursory check for other && / || statements that could become vectorized, but didn't immediately see any. I think we need to be mindful of similar errors in the near future.

michaelhallquist commented 1 year ago

Thanks for this patch, @cjvanlissa. I'll keep an eye out for the length warnings that result from assuming one match/scalar when many are returned.