composeModel: Compose a model with its variables representation

composeModelR Documentation

Compose a model with its variables representation

Description

Compose the function of the model and the functions representing its variables, condModel a list a function reprensenting each variables.

Usage

composeModel(model, condModel, param = list(), control = list())

Arguments

model

character corresponding to the name of the rate model.

condModel

list of functions that represent conditions variables in function of time (v) as the only argument, and to be substitued into the variables of the model. The names attribute of the list correspond to the variable names.

Details

Note that condModel must correspond to a list of functions and not of function names. This is safer as these functions are usually not predefined, but generated using interpolateCond.

Value

Return a new function that only depend on time (represented as time).

Examples

#Example of a call with two variables
conditions <- data.frame(time = seq(0,30,length.out = 10), temp = rnorm(10, 10, 5))
condModel <- interpolateCond(conditions, method = "linear")
model <- "modelLinear"
param = list(a = 1, T0 = 10)

g <- composeModel(model, condModel, param)
x <- 1:20
g(x)


aleblancbio/timescale documentation built on Aug. 27, 2022, 3:01 p.m.