prepDemographics: Add and prep demographic information (static 'events') to...

Description Usage Arguments Examples

Description

Ethnicity is either 'white' or 'non-white'. Age is broken down to decades, with 70-90 decades merged.

Usage

1
prepDemographics(data, demo, ageCategories = c(seq(20, 70, 10), 90))

Arguments

data

dataframe, rows are clinical visits to be classified, columns are features including clinical visits ids and at least the following columns:

  • iois char, patient id

  • startdate = event start date in the format 'YYYY-MM-DD', char

demo

dataframe, patient demograpics and biomarker information, containing columns:

  • iois char, patient id

  • ethnicity char, patient ethnicity, uses value 'WHITE' to differentiate into three categories: WHITE, non-WHITE, and unknown

  • DOB char, date of birth in the format 'YYYY-MM-DD'

  • MSP char, MGMT promoter methytation status, 'U' = unmethylated, 'M' = methylated

returns - data: dataframe, with formated demographics

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data("fake_data")
t <- 'rate'
fake_tumorInfo <- fake_data$events # save tumor location and laterility strings before event cleaning
fake_demo <- fake_data$demo

fake_data$events <- cleanData(fake_data$events, tType = t)

# collect patient info for each event
# note that only eventName, iois, and eventID columns are used for SPM
fake_data <- merge(fake_data$events, fake_data$person, by='iois', all.x=T)
fake_data <- prepDemographics(fake_data, fake_demo) # prep for each event, since age does change

novasmedley/gbmSpm documentation built on May 17, 2019, 10:39 a.m.