View source: R/expandRegimen.R
| expandRegimen | R Documentation |
Expands the compact regimen_trajectory column in locked data
(returned by trial$get_locked_data()) into a long-format data frame
with one row per regimen segment per patient.
The regimen_trajectory column stores each patient's treatment history
as a semicolon-separated string of "name\@time" entries, e.g.
"placebo\@0;low dose\@8.5". expandRegimen parses this into
two additional columns:
regimen — name of the treatment regimen
switch_time_from_enrollment — time from enrollment at which
the patient switched to this regimen
The regimen_trajectory column is dropped from the result.
expandRegimen(data)
data |
a data frame returned by |
a long-format data frame: one row per regimen segment per patient,
with regimen and switch_time_from_enrollment appended and
regimen_trajectory removed.
## Not run:
locked <- trial$get_locked_data('final')
long <- expandRegimen(locked)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.