powered by
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.
binarize_dataset(model, columns, keep = FALSE, all_levels = FALSE)
(Model) Updated Pharmpy model
(Model) Pharmpy model
(array(str) (optional)) The columns to binarize or NULL for all marked as categorical
(logical) Keep the original column in dataset (default is FALSE)
(logical) Create one column per level, otherwise skip last value (default is FALSE)
if (FALSE) { model <- load_example_model("pheno") model <- binarize_dataset(model, c('APGR')) model$dataset }
Run the code above in your browser using DataLab