do.call
expects its first argument to be the 'name' of the function. Usually it works if this is entered as an R symbol (an expression without quotes) or expressed as a single element character value. In this case cfa
is a wrapper for lavaan
and the function name is converted to a list element named 'model.type' which succeeds when it is a character value but not when it is an R symbol-name of a function.
> do.call('cfa',args)
lavaan (0.5-15) converged normally after 56 iterations
Number of observations per group
0 50
1 50
Estimator ML
Minimum Function Test Statistic 0.000
Degrees of freedom 0
P-value (Chi-square) 0.000
Chi-square for each group:
0 0.000
1 0.000