Description Usage Arguments Details Value Examples
This is, broadly speaking a helper function, that turns the txvis
object from a long
table to a wide table with rows for each patient
and columns for regular intervals of dates from a defined start
and end
along
a regular interval
. In cases where treatments overlap within a time bin there are
three coded conflict
resolution methods: (1) majority
in which coding priority
is given to the treatment that occupies the most time within the interval (2) first
in
which coding priority is given to the treatment that occurs first chronologically within the interval (3) last
in which coding priority is given to the treatment that occurs last chronologically within the interval
1 2 |
x |
A |
nsequ |
The number of drug treatment sequences to use (default is |
start |
The starting period for the date matrix. Default is the earliest date in the |
end |
The ending period for the date matrix. Default is the earliest date in the |
interval |
The length of the interval in text format. See Details. |
conflict |
Conflict resolution. |
The interval
argument accepts a range of terms
A data.frame
.
1 2 3 4 5 6 7 | hlth_data <- create_txvis(patient = treat$pat_id,
treatment = treat$treatment,
start = treat$start,
end = treat$end,
date_format = "%d%B%Y")
wide <- reform_dates(hlth_data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.