Skip to contents

Asserts x is a survival::Surv object with added checks

Usage

assert_surv(
  x,
  len = NULL,
  any.missing = TRUE,
  null.ok = FALSE,
  .var.name = vname(x)
)

Arguments

x

Object to check

len

If non-NULL checks object is length len

any.missing

If FALSE then errors if there are any NAs in x

null.ok

If FALSE then errors if x is NULL, otherwise passes

.var.name

Optional variable name to return if assertion fails