omxModelDeleteData: Remove all instances of data from a model

Description Usage Arguments Examples

View source: R/MxModel.R

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

1

Arguments

model

a MxModel object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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/OpenMx documentation built on April 8, 2020, 4:35 a.m.