spread_paths: Spread the information in dose_finding_paths object to a wide...

View source: R/spread_paths.R

spread_pathsR Documentation

Spread the information in dose_finding_paths object to a wide data.frame format.

Description

Spread the information in dose_finding_paths object to a wide data.frame format.

Usage

spread_paths(df = NULL, dose_finding_paths = NULL, max_depth = NULL)

Arguments

df

Optional data.frame like that returned by as_tibble(dose_finding_paths). Columns .depth, .node, .parent are required. All other columns are spread with a suffix reflecting depth.

dose_finding_paths

Optional instance of dose_finding_paths. Required if 'df' is null.

max_depth

integer, maximum depth of paths to traverse.

Value

A data.frame

Examples

## Not run: 
target <- 0.25
skeleton <- c(0.05, 0.15, 0.25, 0.4, 0.6)
paths <- crm_dtps(skeleton = skeleton, target = target, model = 'empiric',
                  cohort_sizes = c(1, 1), next_dose = 3, beta_sd = 1)
spread_paths(dose_finding_paths = paths)

df <- as_tibble(paths)
spread_paths(df)
spread_paths(df %>% select(-fit, -parent_fit, -dose_index))

## End(Not run)

trialr documentation built on April 1, 2023, 12:03 a.m.