binarize_dataset: binarize_dataset

View source: R/functions_wrapper.R

binarize_datasetR Documentation

binarize_dataset

Description

Binarize dataset

Will create one column per category if specified, otherwise for all columns except for the last one. Will also update datainfo so that new columns have type covariate and is categorical.

Usage

binarize_dataset(model, columns, keep = FALSE, all_levels = FALSE)

Arguments

model

(Model) Pharmpy model

columns

(array(str) (optional)) The columns to binarize or NULL for all marked as categorical

keep

(logical) Keep the original column in dataset (default is FALSE)

all_levels

(logical) Create one column per level, otherwise skip last value (default is FALSE)

Value

(Model) Updated Pharmpy model

Examples

## Not run: 
model <- load_example_model("pheno")
model <- binarize_dataset(model, c('APGR'))
model$dataset

## End(Not run)


pharmr documentation built on May 28, 2026, 5:08 p.m.