create_lines_dt: Create a data table of treatment lines

View source: R/hesim_data.R

create_lines_dtR Documentation

Create a data table of treatment lines

Description

Convert a list of treatment lines for multiple treatment strategies to a data.table.

Usage

create_lines_dt(strategy_list, strategy_ids = NULL)

Arguments

strategy_list

A list where each element is a treatment strategy consisting of a vector of treatments.

strategy_ids

A numeric vector denoting the numeric id of each strategy in strategy_list.

Value

Returns a data.table in tidy format with three columns:

strategy_id

Treatment strategy ids.

line

Line of therapy.

treatment_id

Treatment ID for treatment used at a given line of therapy within a treatment strategy.

Examples

strategies <- list(c(1, 2, 3),
                  c(1, 2))
create_lines_dt(strategies)

hesim documentation built on Sept. 4, 2022, 1:06 a.m.