Skip to contents

Predicate that returns TRUE if x carries the "vpc_stats" class — i.e., it is the container returned by df_vpcstats() (also accepted by plot_vpc_cont() on the precomputed-stats fast path).

Usage

is_vpc_stats(x, strict = FALSE)

Arguments

x

Object to test.

strict

Logical. When TRUE, additionally runs validate_vpc_stats() and returns FALSE on validation failure. Default FALSE (class-tag check only, cheap).

Value

Logical scalar.

Examples

model <- model_mread_load(model = "pkmodel")
#> Loading model from cache.
simout <- df_mrgsim_replicate(data = dplyr::filter(data_sad, CMT %in% c(1, 2)),
                              model = model, replicates = 5,
                              dv_var = ODV)
out <- df_vpcstats(simout)
is_vpc_stats(out)        # TRUE
#> [1] TRUE
is_vpc_stats(out$stats)  # FALSE — that's the inner data.frame
#> [1] FALSE