You are here

Revision of mxModel Help from Wed, 01/05/2011 - 17:59

Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.

Wiki home page

Please add material here as you learn...

If you have questions not answers, then add those here: That's how a wiki works.

Basic Examples

# Create an empy model, and place it in an object.
model 

# Create a model named 'firstdraft' with one matrix

model 

# Add other matrices to model 'firstdraft', and rename that model 'finaldraft'

model 

# Add data to the model from an existing data frame in object 'data'

data 

# View the matrix named "A" in MxModel object 'model'

model[["A"]]

# View the data associated with MxModel object 'model'

model@data

Remove an object from a model

You can remove paths, matrices, algebras, and other objects from a model using mxModel, with the to-be-modified model as its first parameter, and then a comma delimited list of the names of the objects you want to remove, setting remove to TRUE
e.g.

  aModel mxModel("aModel", mxMatrix(name="myMatrix", type="Full",nrow=8,ncol=5))
  aMinus mxModel(aModel,  "myMatrix", remove=TRUE)

Here is an example that highlights why you must use the name of the entity. The following code WILL NOT WORK.

A #Oh oh, this would have deleted countainer$A 
accident