Imat2cat: Convert a matrix of binary indicators to categorial variables

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Convert a matrix of binary indicators to categorial variables

Usage

1
Imat2cat(binary_mat, allowed_list, pathogen_list)

Arguments

binary_mat

The matrix of binary indicators. Rows for subjects, columns for pathogens in the "pathogen.list"

allowed_list

The list of allowed single pathogen or pathogen combination

pathogen_list

The complete list of pathogen names

Value

A vector of categorical variables. Its length equals the length of "allowed.list"

Examples

1
Imat2cat(rbind(diag(3),c(1,1,0),c(0,0,0)),c("A","B","C","A+B","NoA"),c("A","B","C"))

zhenkewu/nplcm documentation built on May 4, 2019, 10:19 p.m.