Produces an object suitable to include in a rescomp_param_list
.
rescomp_param_custom(func, display_values = NULL)
A function that takes t
(time) and returns a number to use as a parameter.
A numeric vector of values of the parameter to use in plot_funcresp()
.
If not specified here, must be specified in plot_funcresp()
.
S3 object of class rescomp_param
.
# Repeated pulsing and exponential decay
antibiotic_conc <- rescomp_param_custom(function(t) {
0.5^(10 * (t %% 1))
})
get_params(antibiotic_conc, 0)
#> [1] 1
get_params(antibiotic_conc, 0.5)
#> [1] 0.03125
get_params(antibiotic_conc, 1)
#> [1] 1