Learn R Programming

PatientLevelPrediction (version 3.0.0)

exportPlpDataToCsv: Export all data in a plpData object to CSV files

Description

Export all data in a plpData object to CSV files

Usage

exportPlpDataToCsv(plpData, outputFolder)

Arguments

plpData

An object of type plpData.

outputFolder

The folder on the file system where the CSV files will be created. If the folder does not yet exist it will be created.

Details

Created a set of CSV files in the output folder with all the data in the plplData object. This function is intended to be used for research into prediction methods. The following files will be created:

cohort.csv

Listing all persons and their prediction periods. This file will have these fields: row_id (a unique ID per period), person_id, cohort_start_date, cohort_id, time (number of days in the window).

outcomes.csv

Listing all outcomes per period. This file will have these fields: row_id, outcome_id, outcome_count, time_to_event.

exclude.csv

Either not exported or a file listing per outcome ID which windows had the outcome prior to the window and should therefore be removed prior to fitting the model. This object will have these fields: rowId, outcomeId.

covariates.csv

Listing the baseline covariates per person in the cohorts. This is done using a sparse representation: covariates with a value of 0 are omitted to save space. The covariates file will have three columns: rowId, covariateId, and covariateValue.

covariateRef.csv

A file describing the covariates that have been extracted.

metaData

Some information on how the plpData object was constructed.

Examples

Run this code
# NOT RUN {
exportPlpDataToCsv(plpData, "s:/temp/exportTest")
# }

Run the code above in your browser using DataLab