x = parse_phase1_outcomes('1NNN 2NTN 3TTT')
# Three cohorts of three patients. The first cohort was treated at dose 1 and
# none had toxicity. The second cohort was treated at dose 2 and one of the
# three had toxicity. Finally, cohort three was treated at dose 3 and all
# patients had toxicity.
x$num_patients # 9
x$doses # c(1, 1, 1, 2, 2, 2, 3, 3, 3)
x$tox # c(0, 0, 0, 0, 1, 0, 1, 1, 1)
sum(x$tox) # 4
# The same information can be parsed to a data-frame:
y = parse_phase1_outcomes('1NNN 2NTN 3TTT', as_list = FALSE)
y
Run the code above in your browser using DataLab