Interpolate a Survival / CDF / CIF Vector
vec_interp.Rd
Wrapper around the internal C++ interpolation function c_vec_interp
.
Performs input validation before calling the underlying C++ code.
Can be used for survival, cumulative distribution (CDF), or cumulative
incidence (CIF) curves (vectors).
Usage
vec_interp(
x,
times = NULL,
eval_times = NULL,
constant = TRUE,
type = "surv",
add_times = TRUE,
check = TRUE
)
Arguments
- x
(
numeric()
)
Survival/CDF/CIF vector at given time points. Optionally named with the corresponding times.- times
(
numeric()
|NULL
)
Original time points corresponding tox
. IfNULL
, extracted fromnames(x)
.- eval_times
(
numeric()
|NULL
)
New time points at which to interpolate. Values do not need to be sorted or unique, just non-negative. IfNULL
,x
is returned unchanged.- constant
(
logical(1)
)
IfTRUE
(default), use piecewise-constant (left-continuous) interpolation. IfFALSE
, use piecewise-linear interpolation.- type
(
character(1)
)
One of"surv"
(default),"cdf"
, or"cif"
, indicating the input data type.- add_times
(
logical(1)
)
IfTRUE
(default), column names are set to the relevant time points.- check
(
logical(1)
)
IfTRUE
(default), perform simple validation (range, monotonicity, and bounds). Set toFALSE
to skip checks (NOT recommended for external use).