Fit a list of longitudinal cluster methods on one or more datasets.
latrendBatch(
methods,
data,
cartesian = TRUE,
seed = NULL,
parallel = FALSE,
errorHandling = "stop",
envir = NULL,
verbose = getOption("latrend.verbose")
)
A list
of lcMethod
objects.
The dataset(s) to which to fit the respective lcMethod
on.
Either a data.frame
, matrix
, list
or an expression evaluating to one of the supported types.
Multiple datasets can be supplied by encapsulating the datasets using data = .(df1, df2, ..., dfN)
.
Doing this results in a more readable call
associated with each fitted lcModel
object.
Whether to fit the provided methods on each of the datasets. If cartesian=FALSE
, only a single dataset may be provided or a list of data matching the length of methods
.
Sets the seed for generating a seed number for the methods.
Seeds are only set for methods without a seed argument or NULL
seed.
Whether to enable parallel evaluation. See latrend-parallel. Method evaluation and dataset transformation is done on the calling thread.
Whether to "stop"
on an error, or to "remove'
evaluations that raised an error.
The environment
in which to evaluate the lcMethod
arguments.
The level of verbosity. Either an object of class Verbose
(see R.utils::Verbose for details),
a logical
indicating whether to show basic computation information,
a numeric
indicating the verbosity level (see Verbose),
or one of c('info', 'fine', 'finest')
.
A lcModels
object.
In case of a model fit error under errorHandling = pass
, a list
is returned.
Methods and datasets are evaluated and validated prior to any fitting. This ensures that the batch estimation fails as early as possible in case of errors.
lcMethods
Other longitudinal cluster fit functions:
latrend()
,
latrendBoot()
,
latrendCV()
,
latrendRep()
data(latrendData)
refMethod <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
methods <- lcMethods(refMethod, nClusters = 1:2)
models <- latrendBatch(methods, data = latrendData)
# different dataset per method
models <- latrendBatch(
methods,
data = .(
subset(latrendData, Time > .5),
subset(latrendData, Time < .5)
)
)