BinMatrix2Vector: Matrix of Dummies to Vector

Description Usage Arguments Value Examples

Description

Transforms a matrix of dummies into a numeric vector.

Usage

1
BinMatrix2Vector(Y_matrix, levels_val = NULL)

Arguments

Y_matrix

a numeric, factor or character vector.

levels_val

levels to be considered, default is NULL for automatic levels.

Value

A numeric vector

Examples

1
2
3
4
5
Y <- sample(c(1,4,3), size = 100, replace = TRUE)
Y_matrix <- factor2BinMatrix(Y)
BinMatrix2Vector(Y_matrix = Y_matrix)
BinMatrix2Vector(Y_matrix = Y_matrix, levels_val = unique(Y))
BinMatrix2Vector(Y_matrix = Y_matrix, levels_val = c('a', 'e', 'i'))

PauloCirino/MLAT documentation built on May 13, 2019, 1:22 p.m.