expand_time_at_risk: Expand time at risk

Description Usage Arguments Value Examples

View source: R/expand_time_at_risk.R

Description

Using a time at risk dataframe generated by create_time_at_risk, generate an "expanded" version with one row for each person-day combination

Usage

1
2
expand_time_at_risk(time_at_risk, start_date = "2002-01-01",
  end_date = Sys.Date())

Arguments

time_at_risk

A dataframe generated by create_time_at_risk

Value

A data.frame with one row for each person's uninterrupted period of residency

Examples

1
2
3
4
5
residency <- get_data(tab = 'residency', dbname = 'openhds')
individual <- get_data(tab = 'individual', dbname = 'openhds')
location <- get_data(tab = 'location', dbname = 'openhds')
time_at_risk <- create_time_at_risk(residency = residency, individual = individual, location = location)
#' expanded_time_at_risk <- expand_time_at_risk(time_at_risk = time_at_risk)

joebrew/cism documentation built on May 19, 2019, 2:58 p.m.