im_value2list: Value incidence matrix to list

im_value2listR Documentation

Value incidence matrix to list

Description

Value incidence matrix to list

Usage

im_value2list(x, empty = c(NA, "", 0), ...)

Details

This function is the reciprocal to list2im_value().

A value incidence matrix is a matrix whose non-empty values are retained in each item vector, where items are stored as vector names.

This function is most commonly used with signed values c(-1, 0, 1), to indicate direction where 1 is up, -1 is down, and 0 is ⁠not changed⁠. In this case 0 which is considered empty by default.

Value

list whose names are set names derived from colnames(x), and where each vector is named using rownames(x) and the values from x, for non-empty values.

See Also

Other venndir conversion: counts2setlist(), im2list(), list2im_opt(), list2im_value(), overlaplist2setlist(), signed_counts2setlist()

Examples

setlist <- make_venn_test(100, 3, do_signed=TRUE)
ims <- list2im_value(setlist);
print(head(ims));

# convert back to list
im_value2list(ims);

# make a simple character vector list
setlistv <- lapply(setlist, function(i){
   j <- letters[i+3];
   names(j) <- names(i);
   j;
})
imv <- list2im_value(setlistv);
print(head(imv));
im_value2list(imv);


jmw86069/venndir documentation built on Dec. 14, 2024, 2:36 p.m.