Learn R Programming

StratifiedSampling (version 0.4.1)

disjMatrix: Disjunctive for matrix

Description

This function transforms a categorical matrix into a matrix of indicators variables.

Usage

disjMatrix(strata)

Value

A matrix of indicators.

Arguments

strata

A matrix of integers that contains categorical vector in each column.

Author

Raphaël Jauslin raphael.jauslin@unine.ch

Examples

Run this code
Xcat <-  matrix(c(sample(x = 1:6, size = 100, replace = TRUE),
            sample(x = 1:6, size = 100, replace = TRUE),
            sample(x = 1:6, size = 100, replace = TRUE)),ncol = 3)
disjMatrix(Xcat)

Run the code above in your browser using DataLab