colToDummies: Changes a column containing multiple values to a matrix of...

Description Usage Arguments Value

View source: R/modalities_functions.R

Description

Changes a column containing multiple values to a matrix of columns containing the dummies corresponding to each value.

Usage

1
colToDummies(col, nameCol, modalities = NULL, keepValue = FALSE)

Arguments

col

input column

nameCol

name that will be used as a prefix for dummies column name in the output matrix

modalities

if a vector is entered, dummies produced will only be the ones corresponding to the values in the "modalities" input column + another one containing all the other modalities.

keepValue

Logical. If TRUE, puts not "1"s in the dummies output columns but the real values in the "col" column (except if values are non-numeric)

Value

Matrix containing the dummy columns


icarus documentation built on May 29, 2017, 9:12 a.m.