addDeathDays {PatientProfiles}R Documentation

Add days to death for individuals. Only death within the same observation period than 'indexDate' will be observed.

Description

Add days to death for individuals. Only death within the same observation period than 'indexDate' will be observed.

Usage

addDeathDays(
  x,
  indexDate = "cohort_start_date",
  censorDate = NULL,
  window = c(0, Inf),
  deathDaysName = "days_to_death"
)

Arguments

x

Table with individuals in the cdm.

indexDate

Variable in x that contains the window origin.

censorDate

Name of a column to stop followup.

window

window to consider events over.

deathDaysName

name of the new column to be added.

Value

table x with the added column with death information added.

Examples


cdm <- mockPatientProfiles()
cdm$cohort1 %>%
  addDeathDays()
mockDisconnect(cdm = cdm)



[Package PatientProfiles version 1.0.0 Index]