cjvanlissa / gorica

Informative hypothesis testing using generalized AIC
0 stars 3 forks source link

Illegal lavaan syntax #38

Closed yrosseel closed 10 months ago

yrosseel commented 10 months ago

In at least one of the testthat examples (test-sem_example.R), the following lavaan syntax is used:

model <- '
Cry = ~ y1 + y2 + y3 + y4
Fld = ~ y2 + y3 + y5 + y6 + y7 + y8
Cry ~ edc + age
Fld ~ edc + age
'

Note that in the first two syntax lines, there is space beteen the '=' and '~' symbols. However, lavaan's new parser will no longer allow for this. Is it possible to remove the space in this (and perhaps other) example(s)? Otherwise, it will break the testthat tests and this will prevent the new version of lavaan (0.6-17) to get through the CRAN checks.

cjvanlissa commented 10 months ago

This is fixed by #649201b, but it's been just a few days since gorica was updated so I can't immediately resubmit to CRAN without triggering a manual review.

Is it necessary to make this breaking change?

yrosseel commented 10 months ago

Thanks for the fix!

I understand you cannot (re)submit to CRAN if you just did an update, but that is fine.

We will tolerate the "= ~" version in the next update of lavaan (perhaps with a warning), and then enforce it in a later update. (The same goes for "~ ~" or "~ * ~": we need to get rid of the spaces)

The new parser (soon on github) is doing a much better job in detecting subtle and less subtle errors in the lavaan model syntax. But in order to accomplish this, we must define the operators without spaces (as they were always intended).

cjvanlissa commented 10 months ago

Understood!