get_dummy_code: Show the dummy code of a categorical variable

View source: R/statistics-utils.R

get_dummy_codeR Documentation

Show the dummy code of a categorical variable

Description

For each value of a categorical variables, show the binary code used in a regression model to represent its value. This is wrapper to the fastDummies::dummy_cols() function.

Usage

get_dummy_code(Df, variable)

Arguments

Df

A data frame

variable

A categorical variable (e.g. character vector or factor).

Value

A data frame whose rows provide the dummy code for each distinct value of variable.

Examples

get_dummy_code(PlantGrowth, group)

mark-andrews/psyntur documentation built on Nov. 18, 2024, 7:17 a.m.