Flash Sale | 50% off
Get 50% off unlimited learning

StratifiedSampling (version 0.4.2)

disjMatrix: Disjunctive for matrix

Description

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

Usage

disjMatrix(strata_input)

Value

A matrix of indicators.

Arguments

strata_input

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

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