mxRename {OpenMx} | R Documentation |
This functions renames either the top model or a submodel to a new name. All internal references to the old model name are replaced with references to the new name.
mxRename(model, newname, oldname = NA)
model |
a MxModel object. |
newname |
the new name of the model. |
oldname |
the name of the target model to rename. If NA then rename top model. |
Return a mxModel object with the target model renamed.
The OpenMx User's guide can be found at http://openmx.psyc.virginia.edu/documentation.
library(OpenMx) # create two empty models modelA <- mxModel(model='modelA') modelB <- mxModel(model='modelB') # create a parent model with two submodels modelC <- mxModel(model='modelC', modelA, modelB) # Rename modelC to model1 model1 <- mxRename(modelC, 'model1') # Rename submodel modelB to model2 model1 <- mxRename(model1, oldname = 'modelB', newname = 'model2') model1