mxRename: Rename MxModel or a Submodel

Description Usage Arguments Value References Examples

View source: R/MxRename.R

Description

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.

Usage

1
mxRename(model, newname, oldname = NA)

Arguments

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.

Value

Return a mxModel object with the target model renamed.

References

The OpenMx User's guide can be found at http://openmx.ssri.psu.edu/documentation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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

OpenMx/OpenMx documentation built on Feb. 14, 2020, 8:18 a.m.