imSigned2list | R Documentation |
convert signed incidence matrix to list
imSigned2list(x, empty = c(NA, "", 0, FALSE), ...)
x |
|
empty |
|
... |
additional arguments are ignored. |
This function converts an signed incidence matrix
that contains positive and negative values, or equivalent
data.frame
, to a list of named vectors containing values
c(-1, 1)
to indicate signed direction.
The input matrix
should contain numeric values where
positive and negative values indicate directionality.
When the input contains only logical values c(TRUE,FALSE)
the direction is assumed to be +1
positive.
Values of NA
are converted to zero 0
and therefore ignored.
Values that are logical
with TRUE
and FALSE
are converted
to numeric
before output.
list
of named numeric vectors, where list names
are defined by colnames(x)
, and vector names are derived
from rownames(x)
. Values in each vector indicate the
signed direction, c(-1,1)
.
Other jam list functions:
colors_from_list()
,
im2list_dep()
,
im2list()
,
imSigned2list_dep()
,
list2concordance()
,
list2imSigned()
,
list2im()
im <- matrix(c(0,1,-1,1,1,NA,-1,0,1),
ncol=3,
nrow=3,
dimnames=list(letters[1:3], LETTERS[1:3]))
print(im);
# matrix input
im2list(im);
imSigned2list(im);
imSigned2list(im != 0);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.