Test a lcMethod subclass implementation and its resulting lcModel implementation.
test.latrend(
class = "lcMethodKML",
instantiator = NULL,
data = NULL,
args = list(),
tests = c("method", "basic", "fitted", "predict", "cluster-single", "cluster-three"),
maxFails = 5L,
errorOnFail = FALSE,
clusterRecovery = c("warn", "ignore", "fail"),
verbose = TRUE
)The name of the lcMethod subclass to test.
The class should inherit from lcMethod.
A function with signature (id, time, response, ...),
returning an object inheriting from the lcMethod specified by the class argument.
An optional dataset comprising three highly distinct constant clusters that will be used for testing, represented by a data.frame.
The data.frame must contain the columns "Id", "Time", "Value", "Cluster" of types character, numeric, numeric, and character, respectively.
All trajectories should be of equal length and have observations at the same moments in time.
Trajectory observations are assumed to be independent of time, i.e., all trajectories are constant.
This enables tests to insert additional observations as needed by sampling from the available observations.
Other arguments passed to the instantiator function.
A character vector indicating the type of tests to run, as defined in the *.Rraw files inside the /test/ folder.
The maximum number of allowed test condition failures before testing is ended prematurely.
Whether to throw the test errors as an error. This is always enabled while running package tests.
Whether to test for correct recovery/identification of the original clusters in the test data. By default, a warning is outputted.
Whether the output testing results. This is always disabled while running package tests.
# NOT RUN {
test.latrend("lcMethodRandom", clusterRecovery = "skip")
# }
Run the code above in your browser using DataLab