stretch_nltt_matrix: Stretch matrix 'm' with a timestep resolution of 'dt'.

Description Usage Arguments Value Author(s) Examples

View source: R/stretch_nltt_matrix.R

Description

Stretch matrix 'm' with a timestep resolution of 'dt'.

Usage

1
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

can be 'lower' or 'upper'

Value

The stretched matrix

Author(s)

Richel Bilderbeek

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  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")
  testit::assert(identical(result, expected))

nLTT documentation built on Jan. 13, 2020, 9:06 a.m.