Learn R Programming

pharmr (version 2.2.0)

binarize_dataset: 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)

Value

(Model) Updated Pharmpy model

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)

Examples

Run this code
if (FALSE) {
model <- load_example_model("pheno")
model <- binarize_dataset(model, c('APGR'))
model$dataset
}

Run the code above in your browser using DataLab