omxModelDeleteData {OpenMx} | R Documentation |
Remove all instances of data from a model
Description
For very large data, it can be desirable to discard data after the model is run. That is what the purpose of this function.
Data is discarded from the model and all submodels recursively.
Usage
omxModelDeleteData(model)
Arguments
model |
a MxModel object. |
Examples
library(OpenMx)
data(demoOneFactor)
manifests <- names(demoOneFactor)
latents <- c("G")
factorModel <- mxModel(model="One Factor", type="RAM",
manifestVars = manifests,
latentVars = latents,
mxPath(from=latents, to=manifests),
mxPath(from=manifests, arrows=2),
mxPath(from=latents, arrows=2,free=FALSE, values=1.0),
mxData(cov(demoOneFactor), type="cov",numObs=500)
)
factorFit <-mxRun(factorModel)
object.size(factorFit)
factorFit <- omxModelDeleteData(factorFit)
object.size(factorFit)
factorFit$data
[Package OpenMx version 2.21.11 Index]