Check life table, id columns, life table parameter columns, and other inputs to functions in this package.
[data.table()
]
Input life tables
[character()
]
Columns that uniquely identify each row
of dt
.
[character()
]
Columns containing life table
parameters (qx, lx, etc.)
[logical()
]
Whether to check that
the age groups in the lifetable are all of the same length except for the
terminal age group.
[logical()
]
Whether to check that
each terminal age group starts at the same age.
[logical()
]
Whether to check that the
youngest age group starts at age zero.
[logical()
]
Whether to check for NA values in the
generated variable.
Invisibly returns input dt
. Fails if any assertion fails.
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.