omxModelDeleteData: Remove all instances of data from a model

View source: R/MxModel.R

omxModelDeleteDataR 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


OpenMx documentation built on Oct. 19, 2024, 9:06 a.m.