| lag_time | R Documentation |
Lag time is calculated by projecting a tangent line at the point
of maximum (per-capita) derivative backwards to find the time when it
intersects with the minimum y-value
lag_time(
x = NULL,
y = NULL,
deriv = NULL,
blank = NULL,
trans_y = "log",
na.rm = TRUE,
slope = NULL,
x1 = NULL,
y1 = NULL,
y0 = NULL,
warn_logtransform_warnings = TRUE,
warn_logtransform_infinite = TRUE,
warn_min_y_mismatch = TRUE,
warn_multiple_maxderiv = TRUE,
warn_one_lag = TRUE,
warn_no_lag = TRUE,
warn_blank_length = TRUE
)
x |
|
y |
|
deriv |
|
blank |
A |
trans_y |
One of
|
na.rm |
a |
slope |
Slope to project from |
x1 |
|
y1 |
|
y0 |
|
warn_logtransform_warnings |
|
warn_logtransform_infinite |
|
warn_min_y_mismatch |
|
warn_multiple_maxderiv |
|
warn_one_lag |
|
warn_no_lag |
|
warn_blank_length |
|
For most typical uses, simply supply x, y, and deriv
(using the per-capita derivative and trans_y = 'log').
Advanced users may wish to use alternate values for the slope of the tangent
line (slope), origination point of the tangent line (x1,
y1), or minimum y-value y0. If specified, these values will
override the default calculations. If and only if all of slope,
x1, y1, and y0 are provided, lag_time is
vectorized on their inputs and will return a vector of lag time values.
Typically a scalar of the lag time in units of x. See Details for
cases when value will be a vector.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.