binarize.factor {bsnsing} | R Documentation |
Create Binary Features based on a Factor Vector
Description
Create binary dummy variables based on a factor variable. This function is used internally by binarize
.
Usage
binarize.factor(x, name, y, segments = 10, bin.size = 5)
Arguments
x |
a numeric vector. |
name |
a character string, the variable name of |
y |
a numeric or integer vector of the same length as |
segments |
a positive integer indicating the maximum number of levels allowed in the factor variable. |
bin.size |
a positive integer. It is the minimum number of observations required to fall into each bin. |
Value
a data frame with binary (0 and 1) entries. The column names are indicative of the conditions used to form the corresponding columns.
[Package bsnsing version 1.0.1 Index]