Learn R Programming

tidyvpc (version 1.1.0)

check_order: Perform a consistency check on observed and simulated data.

Description

This function performs a simple consistency check on an observed and simulated dataset to make sure they are consistent with respect to ordering as required by the other functions used in the VPC calculation.

Usage

check_order(obs, sim, tol = 1e-05)

Arguments

obs, sim

A `data.frame` with 2 columns (see Details).

tol

A tolerance for comparing time values.

Value

The number of replicates contained in `sim`.

Details

The consistency check is performed by comparing a combination of unique subject identifier (ID) and time. Both `data.frame`s must be given with those in positions 1 and 2 repectively.

See Also

observed, simulated.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
library(vpc)

exampleobs <- as.data.table(vpc::simple_data$obs)[MDV == 0]
examplesim <- as.data.table(vpc::simple_data$sim)[MDV == 0]

check_order(exampleobs[, .(ID, TIME)], examplesim[, .(ID, TIME)])
# }

Run the code above in your browser using DataLab