Learn R Programming

latrend (version 1.6.1)

strip: Reduce the memory footprint of an object for serialization

Description

Reduce the (serialized) memory footprint of an object.

Usage

strip(object, ...)

# 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

The stripped (i.e., updated) object.

Arguments

object

The model.

...

Not used.

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)
})

Details

Serializing references to environments results in the serialization of the object together with any associated environments and references. This method removes those environments and references, greatly reducing the serialized object size.

See Also

Other lcModel functions: clusterNames(), clusterProportions(), clusterSizes(), clusterTrajectories(), coef.lcModel(), converged(), deviance.lcModel(), df.residual.lcModel(), estimationTime(), externalMetric(), fitted.lcModel(), fittedTrajectories(), getCall.lcModel(), getLcMethod(), ids(), lcModel-class, metric(), model.frame.lcModel(), nClusters(), nIds(), nobs.lcModel(), plot-lcModel-method, plotClusterTrajectories(), plotFittedTrajectories(), postprob(), predict.lcModel(), predictAssignments(), predictForCluster(), predictPostprob(), qqPlot(), residuals.lcModel(), sigma.lcModel(), time.lcModel(), trajectoryAssignments()

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