Description Usage Arguments Details Examples
Convert events into transactions.
1 | createTransactions(event, filename)
|
event |
dataframe of events, where rows are single events, and least the following columns:
|
filename |
path to save transactions file |
Creates a transaction file with the following 'n' columns:
column 1: sequenceID
column 2: timeStamp/eventID
column 3 = number of items
columns 4-n = items in event
Transaction file is to be read by read_baskets
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | data("fake_data")
outputDir <- '~/test'
# save tumor location and laterility strings before event cleaning
fake_tumorInfo <- fake_data$events
fake_demo <- fake_data$demo
# clean data
fake_data$events <- cleanData(fake_data$events, tType = 'rate')
cat('...',nrow(fake_data$events), " events left for SPM after cleaning", '\n')
# collect patient info for each event
fake_data <- merge(fake_data$events, fake_data$person, by='iois', all.x=T)
# prep for each event, since age does change
# get survival labels, these also change
fake_data <- prepDemographics(fake_data, fake_demo)
fake_data <- prepSurvivalLabels(fake_data)
# get first tumor location
fake_data <- getTumorLocation(fake_data, fake_tumorInfo)
# transactions
trans <- createTransactions(event = fake_data,
filename = file.path(outputDir, 'example_transactions.txt'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.