binarize: Binarize a data frame into a super-indicator matrix

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/binarize.R

Description

Convert a data frame with factors into a super-indicator matrix (a.k.a. complete disjunctive table from the french tableau disjonctive complete)

Usage

1
  binarize(variables)

Arguments

variables

data frame with categorical variables (coded as factors)

Value

A super-indicator matrix of binary data

Author(s)

Gaston Sanchez

References

Lebart L., Piron M., Morineau A. (2006) Statistique Exploratoire Multidimensionnelle. Dunod, Paris.

See Also

easyMCA

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
  # load insurance cars dataset
  data(insurance)

  # super-indicator matrix of binary data
  bin_insure = binarize(insurance[,-1])
  head(bin_insure)
  
## End(Not run)

Example output

     private professional companies female male flemish french BD_1890_1949
[1,]       1            0         0      0    1       0      1            0
[2,]       1            0         0      0    1       1      0            0
[3,]       1            0         0      0    1       1      0            0
[4,]       1            0         0      0    1       0      1            0
[5,]       1            0         0      0    1       0      1            1
[6,]       1            0         0      0    1       0      1            0
     BD_1950_1973 BD_unknown Brussels Other_regions BM_minus BM_plus YS<86
[1,]            0          1        0             1        0       1     1
[2,]            0          1        0             1        0       1     1
[3,]            0          1        0             1        0       1     1
[4,]            0          1        0             1        0       1     0
[5,]            0          0        0             1        0       1     1
[6,]            0          1        0             1        0       1     1
     YS>=86 HP<=39 HP>=40 YC_33_89 YC_90_91
[1,]      0      1      0        1        0
[2,]      0      0      1        1        0
[3,]      0      1      0        1        0
[4,]      1      0      1        1        0
[5,]      0      1      0        1        0
[6,]      0      0      1        1        0

DiscriMiner documentation built on May 1, 2019, 10:32 p.m.