dummy: Create Binary Variables

Description Usage Arguments Note

View source: R/dummy.r

Description

This function creates k-1 binary variables, where k is the number of unique values of var. It prints to the console which value will be used as the reference, and therefore won't have a binary variable.

Usage

1
dummy(D, var, rm.var = T)

Arguments

D

A data.table or data.frame

var

A character string of the desired variable to dummy

rm.var

Logical, defaults to TRUE where the original variable will be removed

Note

In keeping with data.table's methodology this function does not need to be assigned to a new object


joshua-ruf/fidelis documentation built on July 20, 2019, 1:56 a.m.