Imat2cat: Convert a matrix of binary indicators to categorical...

View source: R/utils.R

Imat2catR Documentation

Convert a matrix of binary indicators to categorical variables

Description

Convert a matrix of binary indicators to categorical variables

Usage

Imat2cat(binary_mat, cause_list, pathogen_list)

Arguments

binary_mat

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

cause_list

The list of causes

pathogen_list

The complete list of pathogen names

Value

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

Examples


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

zhenkewu/baker documentation built on March 17, 2022, 9:54 p.m.