R/test.R
test.latrend.Rd
Test a lcMethod
subclass implementation and its resulting lcModel
implementation.
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.
This is an experimental function that is subject to large changes in the future. The default dataset used for testing is subject to change.
test.latrend("lcMethodRandom", tests = c("method", "basic"), clusterRecovery = "skip")
#> === Testing lcMethod class "lcMethodRandom" ===
#> == Running tests from "method" ==
#> Tests succeeded.
#> == Running tests from "basic" ==
#> Tests succeeded.
#>
#> ~~ Successfully passed all tests! ~~
#> [1] TRUE