assert: latrend-specific assertions

latrend-assertR Documentation

latrend-specific assertions

Description

Assertions and checks that may be of use for custom model implementations.

Check whether the input is a valid posterior probability matrix (for the given model).

Check whether the dataset does not contain trajectories without any observations. Requires Id column to be factor.

Check whether the provided data.frame represents a longitudinal dataset

Check whether the dataset does not contain trajectories with duplicate observation moments.

Check the number of observation moments for each trajectory

Check whether all trajectories have the same number of observation moments, and are observed at the same moments in time.

Check whether all trajectories don't contain any NA observations.

Check whether there are no trajectories that are only comprised of NA observations

Usage

has_lcMethod_args(object, which)

is_valid_postprob(pp, model = NULL)

no_empty_trajectories(data, id, ids)

is_data(data, id, time, response)

no_trajectories_duplicate_time(data, id, time)

are_trajectories_length(data, min = 1, id, time)

are_trajectories_equal_length(data, id, time)

have_trajectories_noNA(data, id, response)

no_trajectories_allNA(data, id, response)

Arguments

object

The object to test.

which

The argument names. Ellipsis (...) will be ignored.

pp

The posterior probability matrix.

model

The lcModel object. Optional.

id

The id variable

ids

Optional ⁠character vector⁠ of trajectory identifiers that are expected to be present in the data.

time

The time variable

response

The response column name. Optional.

min

The minimum required number.


latrend documentation built on March 31, 2023, 5:45 p.m.