getTumorLocation: Get the tumor location and laterality.

Description Usage Arguments Details Value Examples

Description

Get the tumor location and laterality.

Usage

1
getTumorLocation(data, tumorInfo)

Arguments

data

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

  • id char, clinical visit id in the format "patientID.eventID"

  • iois char, patient id

  • agent_detail char, event attribute

tumorInfo

a dataframe of pre-cleaned events and searches for tumor location

Details

Takes the first event with tumor location information in tumorInfo and convert location into dummy variables for logit since one person can have multiple locations. tumorInfo contains pre-cleaned data (cleanData is used for cleaning events for SPM) agent_details. Also retrieves tumor lateriality.

Assumes location and laterility is in agent_details column. Assumes location is after "Location :" in string. Assumes location and lateriality is unchanged for the remaining events (is static)

Value

data with additional columns containing tumor location dummy variables and tumor laterality

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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
fake_data <- prepSurvivalLabels(fake_data) # get survival labels, these also change

fake_data <- getTumorLocation(fake_data, fake_tumorInfo) # get first tumor location

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