lcMethods: Generate a list of lcMethod objects

Description Usage Arguments Value Examples

View source: R/methods.R

Description

Generates a list of lcMethod objects for all combinations of the provided argument values.

Usage

1
lcMethods(method, ..., envir = NULL)

Arguments

method

The lcMethod to use as the template, which will be updated for each of the other arguments.

...

Any other arguments to update the lcMethod definition with. Values must be scalar, vector, list, or encapsulated in a .() call. Arguments wrapped in .() are passed as-is to the model call, ensuring a readable method. Arguments comprising a single symbol (e.g. a variable name) are interpreted as a constant. To force evaluation, specify arg=(var) or arg=force(var). Arguments of type vector or list are split across a series of method fit calls. Arguments of type scalar are constant across the method fits. If a list is intended to be passed as a constant argument, then specifying arg=.(listObject) results in it being treated as such.

envir

The environment in which to evaluate the method arguments.

Value

A list of lcMethod objects.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(latrendData)
baseMethod <- lcMethodKML("Y", id = "Id", time = "Time")
methods <- lcMethods(baseMethod, nClusters = 1:6)

nclus <- 1:6
methods <- lcMethods(baseMethod, nClusters = nclus)

methods <- lcMethods(baseMethod, nClusters = 3, center = .(mean, mean, median))
length(methods) # 3

methods <- lcMethods(baseMethod, nClusters = 1:3, center = .(mean, mean, median))
length(methods) # 9

latrend documentation built on April 14, 2021, 5:08 p.m.