Learn R Programming

latrend (version 1.5.0)

strip: Reduce the lcModel memory footprint for serialization

Description

Strip a lcModel of non-essential variables and environments in order to reduce the model size for serialization.

Usage

# S4 method for lcMethod
strip(object, ..., classes = "formula")

# S4 method for ANY strip(object, ..., classes = "formula")

# S4 method for lcModel strip(object, ..., classes = "formula")

Value

An lcModel object of the same type as the object argument.

Arguments

object

The lcModel object.

...

Additional arguments.

classes

The object classes for which to remove their assigned environment. By default, only environments from formula are removed.

Implementation

Classes extending lcModel can override this method to remove additional non-essentials.


setMethod("strip", "lcModelExt", function(object, ..., classes = "formula") {
  object <- callNextMethod()
  # further process the object
  return(object)
})

Examples

Run this code
data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
model <- latrend(method, latrendData)
newModel <- strip(model)

Run the code above in your browser using DataLab