In OpenMx 1, we could access the objective with
model@objective
In OpenMx 2, this slot is missing (as the objective now distinguishes explicitly between the expectation and the fit function). So, I guess we should be accessing the objective with
model$expectation
model$fitfunction
Or
model@expectation
model@fitfunction
Is that right?
Yes: in OpenMx 2 the correct thing to do is
model$fitfunction
andmodel$expectation
In general, in OpenMx 2, avoid using @ to access any part of a model: Use $ instead. Helpfully, OpenMx 2 also enables tab-completion for easy discovery of model components.