powered by
Convert a matrix of binary indicators to categorical variables
Imat2cat(binary_mat, cause_list, pathogen_list)
A vector of categorical variables. Its length equals the length of "allowed.list"
"allowed.list"
The matrix of binary indicators. Rows for subjects, columns for pathogens in the "pathogen.list"
"pathogen.list"
The list of causes
The complete list of pathogen names
Imat2cat(rbind(diag(3),c(1,1,0),c(0,0,0)),c("A","B","C","A+B","NoA"),c("A","B","C"))
Run the code above in your browser using DataLab