Learn R Programming

PatientProfiles (version 1.4.2)

addPriorObservation: Compute the number of days of prior observation in the current observation period at a certain date

Description

Compute the number of days of prior observation in the current observation period at a certain date

Usage

addPriorObservation(
  x,
  indexDate = "cohort_start_date",
  priorObservationName = "prior_observation",
  priorObservationType = "days",
  name = NULL
)

Value

cohort table with added column containing prior observation of the individuals.

Arguments

x

Table with individuals in the cdm.

indexDate

Variable in x that contains the date to compute the prior observation.

priorObservationName

name of the new column to be added.

priorObservationType

Whether to return a "date" or the number of "days".

name

Name of the new table, if NULL a temporary table is returned.

Examples

Run this code
# \donttest{
cdm <- mockPatientProfiles()

cdm$cohort1 |>
  addPriorObservation()

mockDisconnect(cdm = cdm)
# }

Run the code above in your browser using DataLab