im_value2list | R Documentation |
Value incidence matrix to list
im_value2list(x, empty = c(NA, "", 0), ...)
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.
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.
Other venndir conversion:
counts2setlist()
,
im2list()
,
list2im_opt()
,
list2im_value()
,
overlaplist2setlist()
,
signed_counts2setlist()
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);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.