gg_laglead: Plot Lag-Lead windows

Description Usage Arguments See Also Examples

View source: R/lag-lead-utils.R

Description

Given data defining a Lag-lead window, returns respective plot as a ggplot2 object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
gg_laglead(x, ...)

## Default S3 method:
gg_laglead(x, tz, ll_fun, ...)

## S3 method for class 'LL_df'
gg_laglead(x, high_col = "grey20",
  low_col = "whitesmoke", grid_col = "lightgrey", ...)

## S3 method for class 'nested_fdf'
gg_laglead(x, ...)

Arguments

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.

high_col

Color used to highlight exposure times within the lag-lead window.

low_col

Color of exposure times outside the lag-lead window.

grid_col

Color of grid lines.

See Also

get_laglead

Examples

1
2
3
4
5
6
7
## Example 1: supply t, tz, ll_fun directly
 gg_laglead(1:10, tz=-5:5,
  ll_fun=function(t, tz) { t >= tz + 2 & t <= tz + 2 + 3})

## Example 2: extract information on t, tz, ll_from data with respective attributes
data("sim_df3", package = "ped")
gg_laglead(sim_df3)

adibender/ped documentation built on Dec. 16, 2019, 12:33 a.m.