Learn R Programming

latrend (version 1.6.1)

getName: Object name

Description

Get the name associated with the given object.

getShortName(): Extracts the short object name

Usage

getName(object, ...)

getShortName(object, ...)

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

# S4 method for NULL getName(object, ...)

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

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

# S4 method for lcModel getName(object)

# S4 method for lcModel getShortName(object)

Value

A nonempty string, as character.

Arguments

object

The object.

...

Not used.

Implementation

When implementing your own lcMethod subclass, override these methods to provide full and abbreviated names.


setMethod("getName", "lcMethodExample", function(object) "example name")

setMethod("getShortName", "lcMethodExample", function(object) "EX")

Similar methods can be implemented for your lcModel subclass, however in practice this is not needed as the names are determined by default from the lcMethod object that was used to fit the lcModel object.

Details

For lcModel: The name is determined by its associated lcMethod name and label, unless specified otherwise.

See Also

getShortName getLabel

Examples

Run this code
method <- lcMethodLMKM(Y ~ Time)
getName(method) # "lm-kmeans"
method <- lcMethodLMKM(Y ~ Time)
getShortName(method) # "LMKM"

Run the code above in your browser using DataLab