View source: R/validate_lifetable.R
validate_lifetable | R Documentation |
Check life table, id columns, life table parameter columns, and other inputs to functions in this package.
validate_lifetable(
dt,
id_cols = c(),
param_cols = c(),
assert_uniform_age_length = FALSE,
assert_uniform_terminal_age = FALSE,
assert_age_start_0 = FALSE,
assert_na = NA
)
dt |
[ |
id_cols |
[ |
param_cols |
[ |
assert_uniform_age_length |
[ |
assert_uniform_terminal_age |
[ |
assert_age_start_0 |
[ |
assert_na |
[ |
This function performs the following checks:
id_cols is a character vector, 'age_start' and 'age_end' are included, and no other age variables are included.
dt is data.table, is unique by id_cols
, has all id_cols
and
param_cols
, 'age_start', 'age_end', and parameter columns are numeric,
all life table parameters >= 0, parameters qx, lx, dx <= 1.
assert_na check assert_na
is a logical.
Invisibly returns input dt
. Fails if any assertion fails.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.