Learn R Programming

PatientProfiles (version 1.4.2)

addFutureObservationQuery: Query to add the number of days till the end of the observation period at a certain date

Description

`r lifecycle::badge("experimental")` Same as `addFutureObservation()`, except query is not computed to a table.

Usage

addFutureObservationQuery(
  x,
  indexDate = "cohort_start_date",
  futureObservationName = "future_observation",
  futureObservationType = "days"
)

Value

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

Arguments

x

Table with individuals in the cdm.

indexDate

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

futureObservationName

name of the new column to be added.

futureObservationType

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

Examples

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

cdm$cohort1 |>
  addFutureObservationQuery()

mockDisconnect(cdm = cdm)
# }

Run the code above in your browser using DataLab