View source: R/getEligiblePeriod.R
getEligiblePeriod | R Documentation |
getEligiblePeriod
is a function to find the first and last clinical event for a given patient. The result can be index date in the folloing process such as splitDataByDate
.
getEligiblePeriod(dxDataFile, idColName, dateColName)
dxDataFile |
A data frame object of clinical diagnostic data with at least 3 columns: ID, ICD, and Date. As for date column, the data format should be YYYY/MM/DD or YYYY-MM-DD. |
idColName |
Column name of ID column in dxDataFile. Data type of this argumant should be string without quotation marks. |
dateColName |
Column name of date column in dxDataFile, and the type of date column should be a date format in R or a string format with date information in YYYY/MM/DD or YYYY-MM-DD. Data type of this argumant should be string without quotation marks. |
The function queries the earliest and latest admission date for each patient.
A new data.table
based on dxDataFile
with the earliest and latest admission date for each patient.
Other data integration functions: selectCases
, splitDataByDate
, getConditionEra
# sample file for example
head(sampleDxFile)
# Earliest and latest admission date for each patient
record <- getEligiblePeriod(sampleDxFile, ID, Date)
head(record)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.