<epiparameter> or NULL to functionAn extension to as.function(), particularly the epiparameter
as.function S3 method, with the added feature that NULLs are converted
into functions that generate a vector of NAs to behave equivalently to
the generator functions output from
as.function(..., func_type = "generate").
If a function is already passed to as_function it will be returned
unchanged.
There is also input checking to error if input is not an <epiparameter>,
function (closure), or for onset-to-event distributions NULL.
as_function(x)A list of functions.
A named list containing either <epiparameter>, function or
NULL. Named list elements are: "contact_distribution",
"infectious_period", "onset_to_hosp", "onset_to_death",
"onset_to_recovery".