load_mcm {parseRPDR} | R Documentation |
Loads match control data into R.
Description
Loads match control tables into the R environment.
Usage
load_mcm(
file,
sep = ":",
id_length = "standard",
na = TRUE,
identical = TRUE,
nThread = parallel::detectCores() - 1
)
Arguments
file |
string, full file path to Mcm.txt. |
sep |
string, divider between hospital ID and MRN. Defaults to :. |
id_length |
string, indicating whether to modify MRN length based-on required values id_length = standard, or to keep lengths as is id_length = asis. |
na |
boolean, whether to remove columns with only NA values. Defaults to TRUE. |
identical |
boolean, whether to remove columns with identical values. Defaults to TRUE. |
nThread |
integer, number of threads to use to load data. |
Value
data table, with matching data.
- ID_case_PMRN
string, Epic PMRN value for a patient in the index cohort, corresponds to Case_Patient_EPIC_PMRN in RPDR. Data is formatted using pretty_mrn().
- ID_case_EMPI
string, EMPI value for a patient in the index cohort, corresponds to Case_Patient_EMPI in RPDR. Data is formatted using pretty_mrn().
- ID_control_PMRN
string, Epic PMRN value for a patient matched to a case in the index cohort, corresponds to Control_Patient_EPIC_PMRN in RPDR. Data is formatted using pretty_mrn().
- ID_control_EMPI
string, EMPI value for a control patient matched to a case in the index cohort, corresponds to Control_Patient_EMPI in RPDR. Data is formatted using pretty_mrn().
- match_strength
string, Number of similar data points between the index patient and the control patient. This number corresponds to the number of controls (Age, Gender, etc.) chosen during the match control query creation process, corresponds to Match_Strength in RPDR.
Examples
## Not run:
#Using defaults
d_mcm <- load_mcm(file = "test_Mcm.txt")
#Use sequential processing
d_mcm <- load_mcm(file = "test_Mcm.txt", nThread = 1)
#Use parallel processing and parse data in MRN_Type and MRN columns and keep all IDs
d_mcm <- load_mcm(file = "test_Mcm.txt", nThread = 20, mrn_type = TRUE, perc = 1)
## End(Not run)