dummyToFactor {CMO}R Documentation

Condense a multiple choice matrix

Description

Condenses a multiple choice matrix (rows=individuals,columns=possible answers) to a vector of column labels.

Usage

dummyToFactor(x)

Arguments

x Input matrix (rows=individuals,columns=possible answers) in 0,1 format

Details

No choice, missing values and multiple choices per row result in NA.

Value

A numeric vector with column number of choice foreach row of the input matrix.

Author(s)

Christian Montel

Examples

#create some 0,1 matrix
mat <- matrix(c(0,1,0,0,1,0,0,0),nrow=2)
dummyToFactor(mat)

[Package CMO version 1.02 Index]