timeShift: Time shift

timeShiftR Documentation

Time shift

Description

Evaluate the time elapsed between two bounds (x1, x2) into a scaled domain given a rate model and condtions that represent its variables.

Usage

timeShift(
  x1,
  scaledPeriod,
  model,
  conditions,
  param = list(),
  control = list(),
  interpolation = "constant",
  assignConstant = "lower"
)

Arguments

x1

numeric vector of initial time from which evaluate the scaling

scaledPeriod

numeric vector of period in the scaled domain to add to x1.

model

character corresponding to the name of the rate model.

conditions

data.frame with columns named time and variables expected to correspond to those of the model.

param

list parameters of the model.

control

list of arguments that control the behaviour of the model.

interpolation

character corresponding to the name of the interpolating method for conditions. Available methods only include constant at the moment and is the default value.

assignConstant

character indicating how to assign scaled time to time when it remains constant on a time interval. Choices are lower and upper for both end of the interval.

Details

Note that x1 and the calculated x2 must be in the time range provided by conditions. See the details section of timescale for the structure of conditions and model and the calculation.

Value

Return a vector of the same length as x1 and x2 representing the scaled time elapsed between those values.

Examples

#Setting entries
conditions <- data.frame(time = seq(0,50,length.out = 100), temp = rnorm(10, 10, 5))
model <- "modelLinear"
param = list(a = 1, T0 = 10)
x1 = seq(1,10,length.out = 10)
scaledPeriod = rep(10,10)

#Calculating x2 time values
x2 <- timeShift(x1, scaledPeriod = scaledPeriod, model = model, conditions = conditions, param = param)
x2

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