Learn R Programming

crmPack (version 2.2.1)

singleDrugData: Extracting Single-Drug Data from Combination Data

Description

[Experimental]

A method that extracts one drug-specific Data object from a two-drug DataCombo object.

Usage

singleDrugData(object, drug, ...)

# S4 method for DataCombo singleDrugData(object, drug)

Value

A Data object containing dose, dose grid and patient-level outcomes corresponding to the selected drug.

Arguments

object

(DataCombo) object from which single-drug data are extracted.

drug

(string) name of the drug to extract. Must be one of object@drugNames.

...

not used.

Examples

Run this code
# Example of extracting single-drug data from two-drug combination data.

my_combo_data <- DataCombo(
  x = cbind(
    drug1 = c(10, 10, 20, 20),
    drug2 = c(20, 20, 20, 40)
  ),
  y = c(0L, 1L, 0L, 0L),
  ID = 1L:4L,
  cohort = c(1L, 2L, 3L, 4L),
  doseGrid = list(
    drug1 = c(10, 20, 30),
    drug2 = c(20, 40)
  )
)

# Extract the data for one specific drug.
singleDrugData(my_combo_data, "drug1")

Run the code above in your browser using DataLab