library(OpenMx)
# Create a parent model with two submodels:
modelC <- mxModel(model= 'modelC',
mxModel(model= 'modelA'),
mxModel(model= 'modelB')
)
# Rename modelC (the top model) to "model1"
model1 <- mxRename(modelC, 'model_1')
# Rename submodel "modelB" to "model_2"
model1 <- mxRename(model1, oldname = 'modelB', newname = 'model_2')
model1
Run the code above in your browser using DataLab