Description Usage Arguments Examples
View source: R/lag-lead-utils.R
Constructs lag-lead window data set from raw inputs or from data objects
with suitable information stored in attributes, e.g., objects created
by as_ped
.
1 2 3 4 5 6 7 | get_laglead(x, ...)
## Default S3 method:
get_laglead(x, tz, ll_fun, ...)
## S3 method for class 'data.frame'
get_laglead(x, ...)
|
x |
Either a numeric vector of follow-up cut points or a suitable object. |
... |
Further arguments passed to methods. |
tz |
A vector of exposure times |
ll_fun |
Function that specifies how the lag-lead matrix should be constructed. First argument is the follow up time second argument is the time of exposure. |
1 2 | get_laglead(0:10, tz=-5:5, ll_fun=function(t, tz) { t >= tz + 2 & t <= tz + 2 + 3})
gg_laglead(0:10, tz=-5:5, ll_fun=function(t, tz) { t >= tz + 2 & t <= tz + 2 + 3})
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.