AnthonyRaborn / ShortForm

Algorithms for creating short forms based on psychometric principles.
10 stars 2 forks source link

lavaan 0.6-18 breaks modelWarningCheck() #20

Closed yrosseel closed 1 month ago

yrosseel commented 2 months ago

This came up during lavaan's revdep checks. The function modelWarningCheck() tries to figure out if any errors or warnings are produced when calling lavaan. This is done using an explicit grep on the key words 'ERROR: ' and 'WARNING: '. See: https://github.com/AnthonyRaborn/ShortForm/blob/643b2d2f9dc068f8067af073586fac3896b57b3e/R/simulated_annealing_internals.R#L439 and https://github.com/AnthonyRaborn/ShortForm/blob/643b2d2f9dc068f8067af073586fac3896b57b3e/R/simulated_annealing_internals.R#L445

However, lavaan (0.6-18, still on github) recently changed its error/warning handling (in order to prepare for internationalization), and a typical error message now looks as this:

Error: lavaan->lav_lavaan_step02_options(): missing observed variables in 
    dataset: y1

As a result, modelWarningCheck() does not work anymore. A simple change could be to make the grepexpr case-insensitive. Or perhaps there is a better way to catch errors/warnings in general?

AnthonyRaborn commented 1 month ago

Thank you for the heads-up on these changes! I have implemented the changes and will push them to CRAN today. If there are still issues with this package, please let me know.