Currently if the user calls omxSetParameters on a non existent label, they get no warning.
For instance
For instance
omxSetParameters (cholFit2, labels=c("im not there"), free = F, value = 0);
It would be nice if that caused an error, as it usually means the user has made a typo (bad because they now think they have freed or reduced their model but have not) or misunderstands what their model contains (worse, I guess :-) ).
This can be done by adding the following code to the function
if(!all(labels %in% names(omxGetParameters(model, indep)))){ stop("all elements of 'labels' must be present in model") }
If people think the current behavior is OK, perhaps add a new parameter "strict=F" or similar, to request an error when a label is found non existent.
#1
mxRename(omxSetParameters(fit1, labels=c("quad11"), free=F, value = 0), "newName")
(Very) often when one sets parameters, it is appropriate to give the new model which is returned its own new name.
Currently this looks like
It would be nice to add a parameter to omxSetParameters() so this is a 1 liner.
added as newName=NA, nothing existing will break
Log in or register to post comments
#2
Log in or register to post comments
#3
Log in or register to post comments
#4
Log in or register to post comments