stretch_nltt_matrix {nLTT} | R Documentation |
Stretch matrix 'm' with a timestep resolution of 'dt'.
Description
Stretch matrix 'm' with a timestep resolution of 'dt'.
Usage
stretch_nltt_matrix(m, dt, step_type)
Arguments
m |
A matrix of 2 columns and at least 2 rows |
dt |
The resulution, a value e [0.0001, 1]. If 'dt' is set to a very small value, this function will stop |
step_type |
when between two points, where the second point has both a higher x and y coordinat, which y coordinat to follow. 'step_type' can be:
|
Value
The stretched matrix
Author(s)
Richèl J.C. Bilderbeek
Examples
m <- matrix( c(c(0.0, 1.0), c(0.5, 1.0)), ncol = 2, nrow = 2)
expected <- matrix(
c(
c(0.0, 0.5, 1.0), # Timepoints
c(0.5, 0.5, 1.0) # Values
),
ncol = 2, nrow = 3
)
result <- stretch_nltt_matrix(m = m, dt = 0.5, step_type = "lower")
all.equal(result, expected)
[Package nLTT version 1.4.9 Index]