event_chart: Create a time-to-event chart using ggplot

View source: R/event_chart.r

event_chartR Documentation

Create a time-to-event chart using ggplot

Description

Inspired by Hmisc::event.chart()

Usage

event_chart(Data, shift = FALSE, scale = 1)

Arguments

Data

A data frame or data.table of dates, organized in the following way (the first two columns are plotted with a line segment, the remaining columns are plotted with a symbol):

  • Column 1: Follow-up start date

  • Column 2: Follow-up end date

  • Additional columns: Additional events that may occur during the follow-up period

shift

Shift time so that 0 represents start of follow-up for everyone? (default: FALSE)

scale

If shifted, what units? (default: scale=1, meaning days)

Examples

df <- read.csv(system.file("extdata/cdcaids.txt", package="breheny"))
event_chart(df, FALSE)
event_chart(df, TRUE)
event_chart(df, TRUE, 365.25)

pbreheny/breheny documentation built on April 26, 2024, 10:40 a.m.