Closed studerus closed 4 years ago
The error in do.call(compareFit, unrotated)
occurs because do.call()
expects a list of arguments that are named (see the args=
description on the ?do.call
help page). You are passing a list without names, so it has no recourse but to try to name the arguments itself by using the information in the list. See what happens when you run lapply(unrotated, enquote)
; those are what do.call()
is trying to name the list elements.
I will close the issue because there is obviously nothing I can add to semTools
source code to prevent users calling do.call()
without naming the arguments. But as you discovered, using setNames()
avoids the error. Another way to avoid the error would be to specifically say that your list is the ...
argument of compareFit()
:
do.call(compareFit, list(... = unrotated))
Perhaps the easiest solution is to avoid unnecessarily using do.call()
at all, since the ...
in compareFit()
already accepts a list (even without names, in which case names will be assigned intuitively):
compareFit(unrotated)
I wanted to run EFAs with increasing number of factors and compare their fit with the following code:
However, the following error occurred:
The error doesn't occur if I use:
or