Learn R Programming

StratifiedSampling (version 0.1.0)

disjMatrix: Disjunctive for matrix

Description

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

Usage

disjMatrix(strata)

Arguments

strata

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

Value

A matrix of indicators.

Examples

Run this code
# NOT RUN {
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