Learn R Programming

latrend (version 1.1.0)

lcMethod-class: lcMethod class

Description

Base class used to define a longitudinal cluster method. It is implemented as a wrapper around a call.

Model estimation is handled through a series of calls implement by the lcMethod object. The calls are made by latrend, in the following order:

  • compose

  • validate

  • prepareData

  • preFit

  • fit

  • postFit

Extracts the assigned label.

Extracts the name of the given object.

Usage

# S4 method for lcMethod
compose(method, envir = NULL)

# S4 method for lcMethod fit(method, data, envir, verbose)

# S4 method for lcMethod getLabel(object, ...)

# S4 method for lcMethod getName(object)

# S4 method for lcMethod getShortName(object, ...)

# S4 method for lcMethod length(x)

# S4 method for lcMethod names(x)

# S4 method for lcMethod preFit(method, data, envir, verbose)

# S4 method for lcMethod prepareData(method, data, verbose)

# S4 method for lcMethod postFit(method, data, model, envir, verbose)

# S4 method for lcMethod validate(method, data, envir = NULL, ...)

Arguments

method

The lcMethod object.

envir

The environment in which the lcMethod should be evaluated

data

The data, as a data.frame, on which the model will be trained.

verbose

A R.utils::Verbose object indicating the level of verbosity.

object

The object to extract the label from.

...

Additional arguments.

x

The lcMethod object.

model

The lcModel object returned by fit().

Value

The updated lcMethod object.

An lcModel object.

The extracted label, as character.

A character vector of argument names.

An environment that will be passed to fit().

A data.frame with the post-processed data.

The updated lcModel object.

Either TRUE if all validation checks passed, or a character containing a description of the failed validation checks.

Slots

arguments

A list representing the arguments of the lcMethod object. Arguments are not evaluated upon creation of the method object. Instead, arguments are stored similar to a call object. Do not modify or access.

sourceCalls

A list of calls for tracking the original call after substitution. Used for printing objects which require too many characters (e.g. ,function definitions, matrices).

Details

Because the lcMethod arguments may be unevaluated, evaluation functions such as [[ accept an envir argument. A default environment can be assigned or obtained from a lcMethod object using the environment() function.

See Also

environment

Other lcMethod implementations: lcMethodAkmedoids, lcMethodCrimCV, lcMethodCustom, lcMethodDtwclust, lcMethodFeature, lcMethodFunFEM, lcMethodGCKM, lcMethodKML, lcMethodLMKM, lcMethodLcmmGBTM, lcMethodLcmmGMM, lcMethodLongclust, lcMethodMclustLLPA, lcMethodMixAK_GLMM, lcMethodMixtoolsGMM, lcMethodMixtoolsNPRM, lcMethodRandom, lcMethodStratify

Other lcMethod functions: [[,lcMethod-method, as.data.frame.lcMethods(), as.data.frame.lcMethod(), as.lcMethods(), as.list.lcMethod(), evaluate.lcMethod(), formula.lcMethod(), update.lcMethod()

Examples

Run this code
# NOT RUN {
getName(lcMethodKML("Y")) # "longitudinal k-means"
getShortName(lcMethodKML("Y")) # "KML"
m = lcMethodKML("Y")
names(m)
# }

Run the code above in your browser using DataLab