Learn R Programming

latrend (version 1.1.0)

lcMethod.call: Create a lcMethod object from a call

Description

Creates a lcMethod class of the specified type Class for the given arguments given in a call, along with any default arguments from reference functions. This function is intended to be used by classes extending lcMethod to provide an easy way to construct the appropriate call object.

Usage

lcMethod.call(Class, call, defaults = list(), excludeArgs = c())

Arguments

Class

The type of lcMethod class

call

The arguments to create the lcMethod from.

defaults

List of function to obtain defaults from for arguments not defined in call.

excludeArgs

The names of the arguments to exclude from the defaults, provided as a character vector.

Value

An object of class Class that extends lcMethod.

See Also

lcMethod

Examples

Run this code
# NOT RUN {
data(latrendData)
lcMethodKML2 <- function(response = "Y", id = "Id", time = "Time", nClusters = 2, ...) {
  lcMethod.call("lcMethodKML", call = stackoverflow::match.call.defaults(),
    defaults = c(kml::kml, kml::parALGO),
    excludeArgs = c("object", "nbClusters", "parAlgo", "toPlot", "saveFreq"))
}
method <- lcMethodKML2(nClusters = 3)
latrend(method, data = latrendData)
# }

Run the code above in your browser using DataLab