List to incidence matrix

list2im_opt(setlist, ...)

Details

This function takes a list of character vectors and returns a numeric matrix whose rownames are entries from the character vectors, colnames are names from the setlist, and whose values are 0 or 1.

Examples

setlist <- list(setA=LETTERS[1:10], setB=LETTERS[7:14]); list2im_opt(setlist);
#> setA setB #> A 1 0 #> B 1 0 #> C 1 0 #> D 1 0 #> E 1 0 #> F 1 0 #> G 1 1 #> H 1 1 #> I 1 1 #> J 1 1 #> K 0 1 #> L 0 1 #> M 0 1 #> N 0 1