Learn R Programming

epigrowthfit (version 0.15.4)

timescale: Compute the Characteristic Time Scale

Description

Computes characteristic time scales corresponding to exponential growth rates.

Usage

timescale(r, units)

Value

1/r, as a difftime if units is not missing.

Arguments

r

a non-negative numeric vector listing exponential growth rates.

units

a character string indicating units for the result. If missing, then the result is “unitless”.

See Also

R0, finalsize.

Examples

Run this code
r <- 10^(-2:0)
units <- "days"
stopifnot(all.equal(timescale(r), 1 / r),
          all.equal(timescale(r, units), .difftime(1 / r, units)))

Run the code above in your browser using DataLab